/* ---------- Theme tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-side: #fafafa;
  --text: #1a1a1a;
  --muted: #5f6368;
  --faint: #8a8f94;
  --border: #e6e6e6;
  --link: #1a5fd0;
  --accent: #c2410c;
  --chip-bg: #f2f2f2;
  --logo-tile: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --bg-side: #161616;
    --text: #e0e0e0;
    --muted: #a3a3a3;
    --faint: #7a7a7a;
    --border: #2a2a2a;
    --link: #7fb0ff;
    --accent: #fb923c;
    --chip-bg: #1f1f1f;
    --logo-tile: #f4f4f4;
  }
}
:root[data-theme="dark"] {
  --bg: #121212;
  --bg-side: #161616;
  --text: #e0e0e0;
  --muted: #a3a3a3;
  --faint: #7a7a7a;
  --border: #2a2a2a;
  --link: #7fb0ff;
  --accent: #fb923c;
  --chip-bg: #1f1f1f;
  --logo-tile: #f4f4f4;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Instrument Sans", -apple-system, system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.layout { display: flex; min-height: 100vh; max-width: 1140px; margin: 0 auto; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.sidebar-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 56px 28px 40px;
  text-align: center;
}
.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 18px;
}
.profile-name { font-size: 20px; font-weight: 600; margin: 0; }
.profile-role { margin: 2px 0 6px; color: var(--muted); }
.profile-tags { margin: 0; font-size: 12px; color: var(--faint); line-height: 1.5; }

.sidebar-links {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 200px;
  font-size: 14px;
}
.sidebar-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.sidebar-link svg { width: 16px; height: 16px; color: var(--muted); }

.theme-toggle {
  margin-top: 28px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; padding: 56px 48px 72px; }
.content { max-width: 760px; }
.bio p { margin: 0 0 14px; }

h2.section {
  font-size: 20px;
  font-weight: 600;
  margin: 44px 0 14px;
}
h3.year {
  font-size: 15px;
  font-weight: 600;
  color: var(--faint);
  margin: 26px 0 4px;
}

/* ---------- Selected (Zamir-style teaser) ---------- */
.feature { margin: 0 0 34px; }
.feature-media {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
}
.feature-media img { width: 100%; height: auto; }
.feature-title {
  display: block;
  margin-top: 12px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Publication rows (Roman-style) ---------- */
.pub {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.pub:last-child { border-bottom: 1px solid var(--border); }
.feature .pub-body { margin-top: 2px; }
.pub-body { flex: 1; min-width: 0; }
.pub-title { font-weight: 600; color: var(--text); }
.pub-title .arrow { color: var(--faint); }
a.pub-title:hover { text-decoration: none; color: var(--link); }
.pub-authors { font-size: 14px; color: var(--muted); margin-top: 2px; }
.pub-authors .me { color: var(--text); font-weight: 600; }
.pub-authors .first { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pub-venue { font-size: 14px; color: var(--muted); margin-top: 2px; }
.pub-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.pub-links a {
  font-size: 13px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text);
}
.pub-links a:hover { text-decoration: none; color: var(--link); }
.pub-thumb {
  width: 160px;
  flex-shrink: 0;
  align-self: flex-start;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
}
.pub-thumb img { width: 100%; height: auto; }
.note { font-size: 13px; color: var(--faint); margin: -6px 0 6px; }

/* ---------- News ---------- */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: flex; gap: 16px; padding: 6px 0; }
.news-date { width: 80px; flex-shrink: 0; color: var(--faint); font-size: 14px; padding-top: 1px; }

/* ---------- Logo strip ---------- */
.logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.logo-item { width: 128px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.4; }
.logo-tile {
  height: 64px;
  border-radius: 8px;
  background: var(--logo-tile);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  margin-bottom: 8px;
}
.logo-tile img { max-height: 48px; width: auto; }
.logo-item .years { color: var(--faint); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); background: var(--bg-side); }
  .sidebar-inner { position: static; height: auto; padding: 32px 16px 24px; }
  .sidebar-links { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; max-width: none; gap: 8px 18px; }
  .theme-toggle { margin-top: 18px; }
  .main { padding: 32px 16px 56px; }
}
@media (max-width: 560px) {
  .pub { flex-direction: column-reverse; gap: 10px; }
  .pub-thumb { width: 100%; max-width: 320px; }
  .logo-item { width: calc(50% - 10px); }
}
