:root {
  --brand-badge-bg: #a31f34;
  --brand-badge-color: white;
  --bg: #09090b;
  --surface: #111113;
  --border: #1e1e22;
  --text: #fafafa;
  --text-secondary: #8a8a95;
  --accent: #22d3ee;
  --accent-dim: rgba(34,211,238,0.12);
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --chat-accent: #10a37f;
  --chat-accent-shadow: rgba(16,163,127,0.4);
  --chat-accent-shadow-hover: rgba(16,163,127,0.6);
  --chat-accent-shadow-bright: rgba(16,163,127,0.8);
  --chat-accent-shadow-dim: rgba(16,163,127,0.3);
  --chat-accent-border: rgba(16,163,127,0.3);
  --chat-accent-border-dim: rgba(16,163,127,0.2);
  --chat-accent-border-focus: rgba(16,163,127,0.5);
  --chat-accent-glow: rgba(16,163,127,0.1);
  --chat-accent-bg: rgba(16,163,127,0.25);
  --chat-accent-bg-strong: rgba(16,163,127,0.8);
  --chat-bg: rgba(10,10,11,0.95);
  --chat-header-bg: rgba(0,0,0,0.3);
  --chat-input-bg: rgba(0,0,0,0.4);
  --chat-input-area-bg: rgba(0,0,0,0.2);
  --chat-text: rgba(255,255,255,0.9);
  --chat-text-dim: rgba(255,255,255,0.5);
  --chat-text-dimmer: rgba(255,255,255,0.3);
  --chat-text-hover-bg: rgba(255,255,255,0.1);
  --chat-input-border: rgba(255,255,255,0.1);
  --chat-msg-assistant-bg: rgba(255,255,255,0.05);
  --chat-msg-assistant-border: rgba(255,255,255,0.2);
  --chat-code-bg: rgba(255,255,255,0.1);
}

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

html { scroll-behavior: smooth; }

/* -- ACCESSIBILITY UTILITIES -- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* -- SKIP LINK (accessibility) -- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  border-radius: 3px;
  z-index: 9999;
  transition: top 0.1s;
}
.skip-link:focus { top: 1rem; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* -- NAV -- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 56px;
  background: var(--nav-bg, rgba(9,9,11,0.85));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  font-family: var(--mono);
  font-weight: 700; font-size: 14px;
  letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 8px;
}
.nav-brand .mit {
  background: var(--brand-badge-bg, #a31f34);
  color: var(--brand-badge-color, white);
  font-size: 10px;
  padding: 2px 5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
/* Nav logo variant (Poon site) */
nav.has-logo {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-content: stretch;
  height: auto; padding-top: 8px; padding-bottom: 8px;
  overflow: visible;
}
nav.has-logo .nav-brand {
  grid-column: 1; justify-self: start;
}
nav.has-logo .nav-hamburger {
  grid-column: 1; /* collapses into brand column when hidden */
}
nav.has-logo .nav-links {
  grid-column: 2;
  justify-self: center;
}
.nav-logo {
  grid-column: 3;
  justify-self: end;
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 101;
  align-self: start; margin-top: -4px; /* visual alignment with nav top edge */
}
.nav-logo img {
  /* 174px = 30% larger than source 134px to overlap from nav into hero */
  height: 174px; width: auto; max-width: 100%;
  transform: scaleX(-1);
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.12));
}
.nav-logo .nav-credit {
  font-size: 7px; color: var(--text-secondary);
  opacity: 0.5; white-space: nowrap;
  font-family: var(--sans);
  margin-top: -2px; /* tighten gap between image and credit text */
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* -- HERO -- */
.hero {
  padding: 140px 40px 80px;
  max-width: 1100px;
  margin: 0 auto;
}
/* When nav has a logo image, the nav is taller (~200px) so hero needs more top padding */
nav.has-logo ~ .hero { padding-top: 210px; }
.hero-ascii {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-secondary);
  white-space: pre;
  margin-bottom: 16px;
  opacity: 0.5;
}
.hero-subtitle {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-bottom: 28px;
  opacity: 0.75;
}
.hero h1 {
  font-family: var(--sans);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 300;
  line-height: 1.3;
  color: var(--text);
  max-width: 800px;
}
.hero h1 strong {
  color: var(--accent);
  font-weight: 500;
}

/* -- HERO TERMINAL -- */
.hero-terminal {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0 36px;
  background: var(--surface);
  width: 100%;
  max-width: 720px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  backdrop-filter: blur(8px);
}
.ht-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid var(--border);
}
.ht-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ht-dot.r { background: #ff5f57; }
.ht-dot.y { background: #febc2e; }
.ht-dot.g { background: #28c840; }
.ht-name { margin-left: 8px; color: var(--text-secondary); font-size: 12px; flex: 1; letter-spacing: 0.04em; }
.ht-count { color: var(--text-secondary); font-size: 12px; }
.ht-thread {
  min-height: 180px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px 16px 8px;
  font-size: 13px;
  line-height: 1.7;
}
.ht-msg { margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.ht-msg-user { color: var(--accent); }
.ht-msg-user::before { content: '❯ '; }
.ht-msg-system { color: var(--text-secondary); font-style: italic; }
.ht-input-row {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  background: rgba(0,0,0,0.02);
}
.ht-prompt { color: var(--accent); font-weight: 700; flex-shrink: 0; font-size: 13px; }
.ht-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--mono); font-size: 13px; color: var(--text); padding: 0;
}
.ht-input::placeholder { color: var(--text-secondary); opacity: 0.55; }
.ht-deep-link {
  font-family: var(--mono); font-size: 11px; color: var(--text-secondary);
  margin: 8px 0 0; max-width: 720px;
}
.ht-deep-link a { color: var(--accent); text-decoration: none; }
.ht-deep-link a:hover { text-decoration: underline; }

/* -- CONTROL LOOP -- */
.control-loop {
  margin-top: 40px;
  max-width: 700px;
}
.control-loop svg {
  width: 100%;
  height: auto;
}
.control-loop text {
  font-family: var(--mono);
}

/* When fusion layout is used, remove parent constraints */
.hero:has(.hero-fusion) {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
.control-loop:has(.hero-fusion) {
  max-width: none;
  margin: 0;
}
/* -- HERO FUSION (TUI left + carousel right) -- */
.hero-fusion {
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}
.fusion-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  min-height: 420px;
  max-height: 520px;
  position: relative;
}
.fusion-gap { display: none; }
/* Carousel (full-width background) */
.fusion-carousel {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s ease;
  will-change: transform;
}
.carousel-slide {
  min-width: 100%;
  position: relative;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carousel-cap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  padding: 14px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}
.carousel-dots {
  position: absolute;
  bottom: 14px; right: 20px;
  display: flex; gap: 8px;
  z-index: 2;
}
.carousel-dots .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: background 0.2s;
}
.carousel-dots .dot.active { background: #fff; }
/* TUI terminal — floating overlay on carousel */
.fusion-tui {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 10;
  width: 420px;
  max-width: 45%;
  margin: 24px;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: hidden;
  align-self: start;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}
.fusion-tui-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #151515;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}
.fusion-tui-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.fusion-tui-bar .dot.r { background: #ff5f57; }
.fusion-tui-bar .dot.y { background: #febc2e; }
.fusion-tui-bar .dot.g { background: #28c840; }
.fusion-tui-bar .title {
  font-family: var(--mono); font-size: 0.75rem;
  color: #999; margin-left: 10px;
}
.fusion-tui-bar .status {
  margin-left: auto;
  font-family: var(--mono); font-size: 0.65rem;
  color: #28c840; letter-spacing: 0.05em;
}
/* ASCII banner */
.tui-banner {
  padding: 10px 16px 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.2;
  color: #1E6C93;
  white-space: pre;
  flex-shrink: 0;
  border-bottom: 1px solid #1a1a1a;
  user-select: none;
}
.tui-banner .dim { color: #3a3a3a; }
.tui-banner .accent { color: #28c840; }
/* Output area */
.tui-output {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.65;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.tui-output::-webkit-scrollbar { width: 5px; }
.tui-output::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
.tui-line { margin-bottom: 2px; word-wrap: break-word; white-space: pre-wrap; }
.tui-line .prompt { color: #28c840; }
.tui-line .user-msg { color: #e0e0e0; }
.tui-line .output { color: #5eafd7; }
.tui-line .comment { color: #555; font-style: italic; }
.tui-line .thinking { color: #666; }
.tui-line .sys { color: #b48ead; }
.tui-line .ok { color: #28c840; }
.tui-line .warn { color: #febc2e; }
.tui-line .mcp { color: #d08770; }
.tui-line .data { color: #999; }
.tui-line .highlight { color: #ebcb8b; }
.tui-line .circuit { color: #5eafd7; letter-spacing: 0; }
.tui-line .bar-fill { color: #28c840; }
.tui-line .bar-empty { color: #333; }
.tui-line .agent { color: #c4a7e7; }
.tui-line .tool { color: #d08770; }
.tui-line .result { color: #8fbcbb; }
.tui-line .spinner { color: #ebcb8b; }
.tui-line .cursor { color: #28c840; animation: blink 0.6s step-end infinite; }
.tui-line .thinking::after {
  content: ''; display: inline-block;
  width: 7px; height: 14px; background: #5eafd7;
  margin-left: 2px; vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
/* Input */
.tui-input-row {
  display: flex; align-items: center;
  padding: 8px 16px;
  border-top: 1px solid #222;
  background: #080808;
  flex-shrink: 0;
}
.tui-input-row .prompt {
  color: #28c840;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: 10px;
  flex-shrink: 0;
}
.tui-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e0e0e0;
  font-family: var(--mono);
  font-size: 0.78rem;
  caret-color: #28c840;
}
.tui-input-row input::placeholder { color: #555; }
/* Selection context badge (appears when user has page text selected) */
.tui-sel-badge, .ht-sel-badge {
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  cursor: help;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  animation: sel-pulse 1.5s ease-in-out infinite;
}
@keyframes sel-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.tui-ctx-tag {
  font-size: 9px;
  color: var(--accent);
  opacity: 0.6;
}
.fusion-kw {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.fusion-kw span {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 4px 14px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  opacity: 0.7;
}
/* fusion-tui and fusion-layout responsive rules consolidated into main media queries below */

/* -- SECTIONS -- */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 40px;
}
.section-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* -- RESEARCH GRID -- */
.pi-bio {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 0 32px 0;
}
.recognitions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 48px;
}
@media (max-width: 480px) {
  .recognitions-list { columns: 1; }
}
.recognition-item {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 7px 0 7px 16px;
  border-bottom: 1px solid var(--border);
  break-inside: avoid;
  position: relative;
}
.recognition-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.research-card {
  background: var(--bg);
  padding: 28px 24px;
  transition: background 0.2s;
  cursor: default;
}
.research-card:hover { background: var(--surface); }
.research-card .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 12px;
}
.research-card h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 10px;
  line-height: 1.4;
}
.research-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.research-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
}
.research-bullets li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 2px 0 2px 14px;
  position: relative;
}
.research-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}
/* Research themes: single-column conventional text layout (personal sites) */
.research-grid--themes {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: none;
  border: none;
}
.research-theme-col { background: none; padding: 0; }
.research-theme-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
  display: inline;
}
.research-theme-items {
  display: inline;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
.research-theme-col > p { margin: 0; }

.research-theme-transitions {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 1px 0 0 0;
  line-height: 1.5;
}
.research-theme-transitions a { color: var(--accent); text-decoration: none; font-weight: 500; }
.research-theme-transitions a:hover { text-decoration: underline; }
.tt-role { color: var(--text-secondary); font-size: 12px; font-weight: 400; }

/* -- TEAM ROSTER (directory-style per-member rows) -- */
.team-roster .role-group { margin-bottom: 24px; }
.team-roster .role-group-header {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.team-roster .role-group-header .count {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 4px;
}
.team-roster .alumni-divider {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  padding: 16px 0 8px;
  border-bottom: 2px solid var(--border);
  margin-top: 32px;
  margin-bottom: 0;
}
.alumni-toggle { font-size: 10px; transition: transform 0.2s; display: inline-block; }
.leaderboard-table.collapsed { display: none; }
.alumni-divider:hover { color: var(--accent); }
.member-info-icon {
  font-size: 14px; opacity: 0.5; cursor: pointer;
  transition: opacity 0.15s;
}
.member-row:hover .member-info-icon { opacity: 1; }

/* Team roster avatars */
.member-avatar-cell { width: 48px; padding: 6px 8px; vertical-align: middle; }
.member-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; display: block;
}
.member-avatar--initials {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--border); color: var(--fg); font-size: 14px;
  font-weight: 600;
}

/* -- PERSON DETAIL MODAL -- */
.person-modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.6);
  align-items: center; justify-content: center;
  padding: 16px;
}
.person-modal-overlay.open { display: flex; }
body.modal-open { overflow: hidden; }
.person-modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 32px 28px 28px;
  display: flex; flex-direction: column; gap: 0;
}
.person-modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  font-size: 20px; color: var(--text-secondary);
  cursor: pointer; padding: 4px 8px; line-height: 1;
  transition: color 0.15s;
}
.person-modal-close:hover { color: var(--text); }
.person-modal-photo { margin-bottom: 20px; }
.person-modal-photo img {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
}
.person-modal-body { display: flex; flex-direction: column; gap: 8px; }
.person-modal-name {
  font-size: 20px; font-weight: 600; margin: 0 0 4px;
}
.person-modal-role {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
}
.person-modal-subgroup, .person-modal-degrees {
  font-family: var(--mono); font-size: 12px; color: var(--text-secondary);
}
.person-modal-bio {
  font-size: 14px; line-height: 1.6; color: var(--text);
  margin: 8px 0 0;
}
.person-modal-label {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary); margin-bottom: 6px;
}
.person-modal-interests {
  font-size: 13px; color: var(--text-secondary);
  font-style: italic;
}
.person-modal-links {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.person-modal-link {
  font-family: var(--mono); font-size: 12px;
  color: var(--accent); text-decoration: none;
  padding: 3px 10px; border: 1px solid var(--accent);
  border-radius: 4px; transition: background 0.15s;
}
.person-modal-link:hover { background: var(--accent-dim); }
.person-modal-pubs { margin-top: 12px; }
.person-modal-pub-item {
  font-size: 13px; padding: 4px 0;
  border-top: 1px solid var(--border);
}
.person-modal-pub-item a { color: var(--text); text-decoration: none; }
.person-modal-pub-item a:hover { color: var(--accent); }
.person-modal-pub-year {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-secondary);
}

/* -- NETWORK CTA -- */
.network-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.network-cta:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.network-cta:hover .arrow { color: var(--accent); }
.network-cta .cta-text h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}
.network-cta .cta-text p {
  font-size: 13px;
  color: var(--text-secondary);
}
.network-cta .arrow {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

/* -- POSITIONS -- */
.positions-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.position-row {
  background: var(--bg); transition: background 0.15s;
}
.position-row:hover { background: var(--surface); }
/* Link-style position rows (homepage + listing page) */
a.position-row, a.position-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; text-decoration: none; color: inherit;
}
a.position-row:hover .title, a.position-card:hover .position-card-title { color: var(--accent); }
a.position-row .title, a.position-card .position-card-title { font-size: 14px; font-weight: 500; }
a.position-row .role, a.position-card .position-card-meta .role {
  display: block; font-size: 12px; font-weight: 400; color: var(--text-secondary); margin-top: 2px;
}
a.position-row .tag, a.position-card .tag {
  font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.04em; flex-shrink: 0;
}
a.position-row .chevron, a.position-card .position-card-arrow {
  margin-left: 12px; font-size: 14px; color: var(--text-secondary); flex-shrink: 0;
}
/* Position listing page */
.position-list-page { max-width: 800px; margin: 0 auto; padding: 0 24px 48px; }
.position-category-block { margin-bottom: 2rem; }
.position-category-heading { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 8px; }
.position-card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Position detail page */
.position-detail-body { max-width: 800px; margin: 0 auto; padding: 0 24px 48px; line-height: 1.75; }
.position-detail-body h1 { font-size: 1.4rem; margin: 0 0 1.2rem; }
.position-detail-body h2 { font-size: 1.15rem; color: var(--accent); margin: 1.5rem 0 0.6rem; }
.position-detail-body h3 { font-size: 1rem; margin: 1.2rem 0 0.4rem; }
.position-detail-body p { margin-bottom: 0.7rem; font-size: 14px; }
.position-detail-body ul, .position-detail-body ol { margin-left: 1.5rem; margin-bottom: 0.7rem; font-size: 14px; }
.position-detail-body li { margin-bottom: 0.3rem; }
.position-detail-body strong { color: var(--accent); }
.position-detail-body a { color: #93c5fd; }
.position-detail-body a:hover { text-decoration: underline; }
.position-detail-body .position-refs { margin-top: 1.2rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.position-detail-body .position-refs h3 { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.position-detail-body .position-refs ol { font-size: 13px; }
/* Shared pill tags and Google Doc link */
.tag-pill { display: inline-block; font-family: var(--mono); font-size: 11px; color: var(--accent); border: 1px solid var(--border); padding: 2px 8px; border-radius: 3px; letter-spacing: 0.04em; }
.tag-pill.secondary { color: var(--text-secondary); }
.gdrive-link { font-size: 13px; color: var(--accent); }
.position-body .loading-indicator { color: var(--text-secondary); font-size: 13px; font-family: var(--mono); }
.position-category {
  font-size: 11px; font-family: var(--mono); color: var(--text-secondary);
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 10px 24px 6px; background: var(--bg);
}

/* -- NEWS FEED -- */
.news-feed { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; }
.news-card { background: var(--surface); padding: 16px 20px; transition: background 0.15s; }
.news-card a { text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.news-card:hover { background: var(--accent-dim); }
.news-card-header { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.news-title { color: var(--accent); font-weight: 500; line-height: 1.3; }
.news-summary { color: var(--text-secondary); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { font-family: var(--mono); font-size: 11px; color: var(--text-secondary); }
.news-type-badge { font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 3px; background: var(--accent-dim); color: var(--accent); white-space: nowrap; flex-shrink: 0; }
.news-type-award { background: rgba(250,204,21,0.15); color: #facc15; }
.news-type-press { background: rgba(168,85,247,0.15); color: #a855f7; }
.news-type-grant { background: rgba(34,197,94,0.15); color: #22c55e; }
.news-empty { opacity: 0.4; font-family: var(--mono); font-size: 12px; padding: 16px 20px; }
.news-load-more { width: 100%; padding: 12px; background: var(--surface); border: none; color: var(--accent); font-family: var(--mono); font-size: 12px; cursor: pointer; transition: background 0.15s; }
.news-load-more:hover { background: var(--accent-dim); }

/* -- VENTURE ROWS WITH LOGOS -- */
.venture-row { background: var(--surface); transition: background 0.15s; }
.venture-row a {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; text-decoration: none;
}
.venture-row:hover { background: var(--accent-dim); }
.venture-logo {
  width: 96px; height: 48px; object-fit: contain;
  border-radius: 6px; flex-shrink: 0;
  background: rgba(255,255,255,0.06); padding: 6px;
}
.venture-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.venture-info .title { font-family: var(--mono); font-size: 14px; color: var(--text); }
.venture-meta { opacity: 0.5; font-weight: 400; }
.venture-desc { font-size: 13px; color: var(--text-secondary); font-family: var(--sans); margin: 0; }
.venture-ticker {
  font-size: 11px; font-family: var(--mono);
  padding: 2px 20px 6px 76px; opacity: 0.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.venture-ticker:empty { display: none; }
.venture-ticker a { color: var(--accent); text-decoration: none; }
.venture-ticker a:hover { opacity: 1; text-decoration: underline; }

/* -- CONTACT -- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.pi-portrait { grid-column: 1 / -1; text-align: center; }
.pi-portrait img {
  width: 160px; height: 160px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border);
}
.contact-grid p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.contact-grid strong { color: var(--text); font-weight: 500; }
.contact-grid a { color: var(--accent); }
.contact-chat-prompt {
  margin-top: 24px; padding: 16px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
}
.contact-chat-btn {
  display: inline-block; text-decoration: none;
  background: var(--accent); color: var(--bg, #fff); border: none;
  padding: 8px 18px; border-radius: 4px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: opacity 0.15s;
}
.contact-chat-btn:hover { opacity: 0.85; }
.contact-chat-hint {
  display: block; margin-top: 8px;
  font-size: 13px; color: var(--text-secondary);
}

/* -- FOOTER -- */
footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.footer-crosslink {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.footer-crosslink:hover { opacity: 1; text-decoration: underline; }

/* -- DATASETS LEADERBOARD -- */
.leaderboard-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.leaderboard-tabs {
  display: flex; gap: 0; border: 1px solid var(--border); overflow: hidden;
}
.leaderboard-tabs button {
  font-family: var(--mono); font-size: 12px;
  background: var(--bg); color: var(--text-secondary);
  border: none; padding: 8px 16px; cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.leaderboard-tabs button:last-child { border-right: none; }
.leaderboard-tabs button:hover { background: var(--surface); color: var(--text); }
.leaderboard-tabs button.active { background: var(--accent-dim); color: var(--accent); }
.leaderboard-search {
  font-family: var(--mono); font-size: 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); padding: 8px 14px;
  width: 260px; outline: none; transition: border-color 0.2s;
}
.leaderboard-search:focus { border-color: var(--accent); }
.leaderboard-search::placeholder { color: var(--text-secondary); }
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table thead th {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--text-secondary); letter-spacing: 0.06em;
  text-transform: uppercase; text-align: left;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.leaderboard-table thead th:last-child { text-align: right; }
.leaderboard-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s; cursor: pointer;
}
.leaderboard-table tbody tr:hover { background: var(--surface); }
.leaderboard-table td { padding: 12px 16px; vertical-align: middle; }
.leaderboard-table .rank {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-secondary); width: 40px;
}
.leaderboard-table .ds-name { font-size: 14px; font-weight: 500; }
.leaderboard-table .ds-source {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-secondary); display: block; margin-top: 2px;
}
.leaderboard-table .ds-stat {
  font-family: var(--mono); font-size: 13px;
  color: var(--accent); text-align: right;
}
.leaderboard-table .ds-tag {
  font-family: var(--mono); font-size: 10px;
  padding: 2px 6px; letter-spacing: 0.04em;
  border: 1px solid var(--border); color: var(--text-secondary);
  display: inline-block; margin-right: 4px;
}
.leaderboard-count {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-secondary); margin-top: 12px;
}

/* -- SCROLLING BANNER -- */
.hero-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  overflow: hidden;
}
.hero-banner .mit-badge {
  background: var(--brand-badge-bg, #a31f34);
  color: var(--brand-badge-color, white);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  vertical-align: super;
}
.hero-banner .scroll-track {
  overflow: hidden;
  flex: 1;
  mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent);
}
.hero-banner .scroll-inner {
  display: flex;
  gap: 0;
  white-space: nowrap;
  animation: scroll-left 28s linear infinite;
  width: max-content;
  will-change: transform;
}
.hero-banner .scroll-inner:hover {
  animation-play-state: paused;
}
.hero-banner .assoc-item {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  padding: 0 12px;
}
.hero-banner .assoc-sep {
  color: var(--accent);
  opacity: 0.4;
  font-size: 10px;
  padding: 0 4px;
  align-self: center;
}
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* -- HAMBURGER BUTTON (hidden on desktop) -- */
.nav-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 32px; height: 24px;
  position: relative; z-index: 102;
  flex-direction: column; justify-content: space-between;
  padding: 0;
}
.nav-hamburger span {
  display: block; width: 100%; height: 2px;
  background: var(--text); border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}
/* 11px = (24px button height - 2px bar height) / 2, centers bars for X shape */
.nav-hamburger.open span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

/* ── Projects list ── */
.projects-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.projects-list .project-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.projects-list .project-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.projects-list .project-item a {
  display: block;
  color: var(--text);
  text-decoration: none;
}
.project-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--surface);
}
.project-info {
  padding: 14px 16px;
}
.project-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  line-height: 1.4;
}
.project-info p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}
.projects-list .blog-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}
.projects-list a:hover strong { color: var(--accent); }

/* -- BLOG-STYLE PROJECT LIST -- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 720px;
}
.blog-entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.blog-entry:last-child { border-bottom: none; }
.blog-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--mono);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.blog-entry h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.blog-entry h3 a {
  color: var(--accent);
  text-decoration: none;
}
.blog-entry h3 a:hover { text-decoration: underline; }
.blog-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* -- PROJECT DETAIL PAGE -- */
.project-header {
  max-width: 800px;
  margin: 100px auto 0;
  padding: 0 40px;
}
.project-header h1 {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 12px;
}
.project-header .tagline {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}
.project-header .links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.project-header .links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.project-header .links a:hover { text-decoration: underline; }
.project-body {
  max-width: 800px;
  margin: 48px auto;
  padding: 0 40px;
}
.project-step {
  margin-bottom: 40px;
}
.project-step h2 {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.project-step .step-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}
.project-step .step-body p { margin-bottom: 12px; }
.project-team {
  max-width: 800px;
  margin: 0 auto 60px;
  padding: 0 40px;
}
.project-team h2 {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.project-team-list {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.project-team-member {
  font-size: 14px;
}
.project-team-member .role {
  font-size: 12px;
  color: var(--text-secondary);
}
.project-back {
  max-width: 800px;
  margin: 0 auto 60px;
  padding: 0 40px;
}
.project-back a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.project-back a:hover { color: var(--accent); }
.project-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
}
@media (max-width: 768px) {
  .project-header { margin-top: 70px; padding: 0 20px; }
  .project-header h1 { font-size: 24px; }
  .project-body { padding: 0 20px; }
  .project-team { padding: 0 20px; }
  .project-back { padding: 0 20px; }
}

/* -- RESPONSIVE: TABLET (<=768px) -- */
@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column; gap: 0; padding: 8px 0;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  }
  /* Disable backdrop-filter on mobile — expensive on mobile GPUs */
  nav, .fusion-tui, #ai-chat-popup { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 24px; display: block;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:last-child { border-bottom: none; }

  /* Nav logo variant (Poon) on tablet */
  nav.has-logo {
    display: flex; flex-wrap: wrap;
    grid-template-columns: unset;
    height: auto; padding: 8px 20px;
  }
  nav.has-logo .nav-brand { flex: 1; min-width: 0; }
  nav.has-logo .nav-links {
    justify-self: unset; order: 3; flex-basis: 100%;
  }
  .nav-logo {
    order: 2; margin-left: 12px;
    align-self: start; margin-top: 0;
  }
  /* 80px = scaled down from 174px desktop for tablet viewports */
  .nav-logo img { height: 80px; }

  .hero, section, footer { padding-left: 20px; padding-right: 20px; }
  .hero { padding-top: 100px; padding-bottom: 40px; }
  /* Nav logo is 80px on tablet, so hero needs ~110px clearance */
  nav.has-logo ~ .hero { padding-top: 110px; }

  /* Carousel / fusion */
  .fusion-tui { width: auto; max-width: none; margin: 12px; }
  .fusion-layout { min-height: 340px; max-height: 440px; }

  /* Research grid */
  .research-grid { grid-template-columns: 1fr; }

  /* Directory */
  .leaderboard-header { flex-direction: column; align-items: stretch; }
  .leaderboard-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .leaderboard-search { width: 100%; font-size: 16px; } /* 16px prevents iOS auto-zoom */
  .leaderboard-table .rank { display: none; }
  .leaderboard-table td { padding: 10px 8px; }

  /* Team roster */
  .team-roster .role-group { margin-bottom: 16px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 24px; }

  /* Footer */
  footer { flex-direction: column; gap: 8px; text-align: center; }

  /* Chat popup responsive rules in chat-widget.css */

  /* Positions */
  .position-row { padding: 14px 16px; }
}

/* -- RESPONSIVE: PHONE (<=480px) -- */
@media (max-width: 480px) {
  nav { padding: 0 16px; height: 48px; }
  .nav-brand { font-size: 12px; gap: 6px; }
  .nav-brand .mit { font-size: 9px; padding: 2px 4px; }

  nav.has-logo { padding: 6px 16px; }
  /* 60px = scaled down from 80px tablet for phone viewports */
  .nav-logo img { height: 60px; }
  .nav-logo .nav-credit { font-size: 6px; }

  .hero { padding-top: 80px; padding-bottom: 24px; }
  /* Nav logo is 60px on phone, so hero needs ~90px clearance */
  nav.has-logo ~ .hero { padding-top: 90px; }
  .hero, section { padding-left: 16px; padding-right: 16px; }
  section { padding-top: 40px; padding-bottom: 40px; }
  .section-label { font-size: 10px; margin-bottom: 20px; }

  .fusion-layout { min-height: 300px; max-height: 400px; }
  .fusion-tui { margin: 8px; }
  .fusion-tui-bar .title { font-size: 0.65rem; }
  .tui-output { font-size: 0.7rem; padding: 8px 12px; }
  .tui-input-row { padding: 6px 12px; }
  .tui-input-row input { font-size: 0.7rem; }
  .tui-banner { font-size: 0.55rem; padding: 6px 12px; }

  .hero-ascii { font-size: 5px; margin-bottom: 16px; }
  .hero h1 { font-size: 22px; }
  .hero-banner .assoc-item { font-size: 10px; }

  /* Team roster: tighter spacing on phone */
  .team-roster .role-group-header { font-size: 11px; padding: 6px 0; }
  .team-roster .alumni-divider { font-size: 12px; margin-top: 24px; }

  /* Directory table */
  .leaderboard-tabs button { font-size: 11px; padding: 6px 10px; }
  .leaderboard-table .ds-source { font-size: 11px; }

  /* Research cards */
  .research-card { padding: 20px 16px; }
  .research-card h3 { font-size: 14px; }
  .research-card p { font-size: 12px; }

  /* Contact */
  .pi-portrait img { width: 120px; height: 120px; }

  /* Footer */
  footer { padding: 24px 16px; }
  footer span { font-size: 11px; }

  /* Network CTA */
  .network-cta { padding: 20px; gap: 16px; flex-direction: column; align-items: flex-start; }
  .network-cta .arrow { margin-left: 0; }
}

/* Chat widget styles live in chat-widget.css — responsive overrides only here */

/* -- REDUCED MOTION: Accessibility (WCAG 2.1 SC 2.3.3) + battery savings -- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ===========================================================================
   CV Page Styles (extracted from templates/cv.html)
   =========================================================================== */
body.cv-page {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* Screen-only navigation */
.cv-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.cv-nav a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-right: 24px;
}

.cv-nav a:hover {
  color: var(--accent);
}

.cv-nav .brand {
  font-weight: 600;
  margin-right: auto;
}

.cv-nav .brand .badge {
  background: var(--brand-badge-bg);
  color: var(--brand-badge-color);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-right: 8px;
}

/* Format dropdown */
.cv-format-dropdown {
  position: relative;
  display: inline-block;
  margin-right: 24px;
}

.cv-format-trigger {
  cursor: pointer;
}

.cv-format-trigger .caret {
  font-size: 0.65rem;
  vertical-align: middle;
}

.cv-format-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 140px;
  padding: 4px 0;
  z-index: 200;
  margin-top: 4px;
}

.cv-format-dropdown:hover .cv-format-menu,
.cv-format-dropdown:focus-within .cv-format-menu {
  display: block;
}

.cv-format-menu a {
  display: block;
  padding: 6px 14px;
  font-size: 0.8rem;
  margin-right: 0;
}

.cv-format-menu a:hover {
  background: var(--accent-dim);
}

.cv-format-menu a.active {
  color: var(--accent);
  font-weight: 600;
}

/* Main content */
.cv-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}

/* Header */
.cv-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--accent);
}

.cv-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.cv-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-family: var(--mono);
}

.cv-header .subtitle a {
  color: var(--accent);
  text-decoration: none;
}

.cv-header .subtitle a:hover {
  text-decoration: underline;
}

.cv-header .cv-address {
  margin-top: 4px;
}

/* Sections */
.cv-section {
  margin-bottom: 36px;
}

.cv-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.cv-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  margin-top: 12px;
}

/* Education and Employment items */
.cv-item {
  margin-bottom: 12px;
  padding-left: 0;
}

.cv-item .role {
  font-weight: 600;
  color: var(--text);
}

.cv-item .org {
  color: var(--text);
}

.cv-item .dates {
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.85rem;
  float: right;
}

.cv-item .detail {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Publications list */
.pub-list {
  list-style: none;
  padding: 0;
  counter-reset: pub-counter;
}

.pub-list li {
  margin-bottom: 10px;
  padding-left: 40px;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.5;
  counter-increment: pub-counter;
}

.pub-list li::before {
  content: counter(pub-counter) ".";
  position: absolute;
  left: 0;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.8rem;
  width: 32px;
  text-align: right;
}

.pub-list .pub-title {
  font-weight: 500;
}

.pub-list .pub-journal {
  font-style: italic;
  color: var(--text-secondary);
}

.pub-list .pub-year {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pub-list a {
  color: var(--accent);
  text-decoration: none;
}

.pub-list a:hover {
  text-decoration: underline;
}

/* Professional Preparation 3-column table */
.cv-prep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.cv-prep-table th {
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  padding: 0.35rem 0.75rem 0.35rem 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.cv-prep-table td {
  padding: 0.3rem 0.75rem 0.3rem 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.cv-prep-table tr:last-child td {
  border-bottom: none;
}

/* Long-form CV bio */
.cv-bio-para {
  line-height: 1.7;
  margin: 0 0 1rem;
  color: var(--text);
}

.cv-awards-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
}

/* Ventures list */
.venture-item {
  margin-bottom: 10px;
}

.venture-item .name {
  font-weight: 600;
}

.venture-item .desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.venture-item a {
  color: var(--accent);
  text-decoration: none;
}

/* Summary stats */
.cv-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.cv-stats .stat-value {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Print styles */
@media print {
  .cv-nav {
    display: none !important;
  }

  body {
    background: white;
    color: #111;
    font-size: 11pt;
    line-height: 1.4;
  }

  .cv-container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .cv-header {
    border-bottom-color: #111;
  }

  .cv-header h1 {
    font-size: 18pt;
    color: #111;
  }

  .cv-header .subtitle {
    color: #444;
  }

  .cv-section h2 {
    color: #111;
    border-bottom-color: #ccc;
    font-size: 12pt;
  }

  .cv-item .dates {
    color: #444;
  }

  .cv-item .detail {
    color: #444;
  }

  .pub-list li {
    font-size: 10pt;
    margin-bottom: 4px;
  }

  .pub-list .pub-journal {
    color: #444;
  }

  .pub-list a {
    color: #111;
    text-decoration: none;
  }

  a[href]::after {
    content: none !important;
  }

  .cv-stats {
    color: #444;
  }

  .cv-stats .stat-value {
    color: #111;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .cv-container {
    padding: 70px 16px 40px;
  }

  .cv-header h1 {
    font-size: 1.5rem;
  }

  .cv-item .dates {
    float: none;
    display: block;
    margin-bottom: 2px;
  }

  .cv-stats {
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* Loading placeholder for skeleton/loading states */
.loading-placeholder {
  opacity: 0.4;
  font-family: var(--mono);
  font-size: 12px;
}
