:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2a3d;
  --muted: #5a6475;
  --accent: #2c9fda;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #4cc9f0;
  --border: #1f2937;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.brand {
  font-family: 'Newsreader', 'Space Grotesk', serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}

.nav-links a {
  color: var(--muted);
  font-weight: 500;
}

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

.actions { display: flex; justify-content: flex-end; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: var(--shadow);
}

.theme-toggle .icon { font-size: 0.95rem; line-height: 1; }

.page {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.75rem;
}

.sidebar { position: sticky; top: 6rem; align-self: start; }

.avatar {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe, #c7d2fe);
  border: 6px solid var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar .initials {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  display: none;
}

.avatar.fallback .initials { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem 1.5rem;
}

.card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
}

.role { margin: 0 0 0.9rem; color: var(--muted); font-weight: 600; }

.meta { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.meta li { display: grid; grid-template-columns: 20px 1fr; align-items: center; color: var(--muted); font-weight: 500; }
.meta a { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.8rem 1rem;
  margin-top: 1rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #1c7dc9);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(44, 159, 218, 0.35);
}

.btn.secondary {
  width: auto;
  padding: 0.7rem 1.1rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.content { display: grid; gap: 1.35rem; }

.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
}

.eyebrow { letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 0.35rem; font-size: 0.8rem; }

h2 { margin: 0 0 0.65rem; font-size: 1.75rem; line-height: 1.3; }

h3 { margin: 0 0 0.6rem; font-size: 1.25rem; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }

.paper-title { font-weight: 700; font-size: 1.02rem; }
.paper-meta { color: var(--muted); margin: 0.35rem 0; }
.inline-link { font-weight: 600; }
.note { margin: 0.4rem 0 0; color: var(--muted); }

.cta { margin-top: 1rem; }

@media (max-width: 1024px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; align-items: center; }
  .avatar { margin: 0; }
  .card { width: 100%; }
}

@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr; justify-items: start; }
  .nav-links { order: 3; width: 100%; flex-wrap: wrap; }
  .actions { width: 100%; justify-content: flex-start; }
  .sidebar { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
