:root {
  --bg: #1e1e1e;
  --bg-elev: #262626;
  --border: #363636;
  --text: #dadada;
  --text-dim: #b3b3b3;
  --text-faint: #7a7a7a;
  --accent: #a78bfa;
  --accent-dim: rgba(167, 139, 250, 0.14);
  --radius: 14px;
  --maxw: 720px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background-image: radial-gradient(circle at 50% -10%, rgba(167, 139, 250, 0.07), transparent 45%);
  background-repeat: no-repeat;
}

a { color: var(--accent); text-decoration: none; transition: color .18s ease, opacity .18s ease; }
a:hover { opacity: .82; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(30, 30, 30, 0.78);
  border-bottom: 1px solid var(--border);
}
nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
nav .brand { font-weight: 600; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
nav .brand:hover { opacity: 1; color: var(--text); }
nav .links { display: flex; gap: 22px; font-size: .9rem; }
nav .links a { color: var(--text-dim); }
nav .links a:hover { color: var(--text); opacity: 1; }
nav .links a.active { color: var(--accent); }
@media (max-width: 560px) { nav .links { gap: 14px; font-size: .82rem; } }

/* ---------- Page header ---------- */
header.hero {
  padding: 72px 0 40px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.avatar {
  flex: 0 0 auto;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  border: 1px solid var(--border);
  filter: grayscale(1) contrast(1.02);
  transition: filter .3s ease;
}
.avatar:hover { filter: grayscale(0) contrast(1); }
.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.hero .role { color: var(--text-dim); font-size: 1.02rem; }
.hero .socials { margin-top: 14px; display: flex; gap: 16px; font-size: .88rem; }
.hero .socials a { color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.hero .socials a:hover { color: var(--accent); opacity: 1; }
@media (max-width: 560px) {
  header.hero { flex-direction: column; align-items: flex-start; gap: 22px; padding: 52px 0 32px; }
  .hero h1 { font-size: 1.7rem; }
}

header.page-header {
  padding: 64px 0 40px;
}
header.page-header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
header.page-header p { font-size: 1rem; color: var(--text-dim); }

/* ---------- Sections ---------- */
section { padding: 30px 0; border-top: 1px solid var(--border); }
.section-title {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 22px;
}

p { color: var(--text-dim); }
p + p { margin-top: 14px; }

/* ---------- Timeline entries ---------- */
.entry { margin-bottom: 22px; }
.entry:last-child { margin-bottom: 0; }
.entry .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.entry .title { font-weight: 600; color: var(--text); }
.entry .date {
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.entry .sub { color: var(--text-dim); font-size: .95rem; margin-top: 3px; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 14px; }
.card {
  display: block;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.card:hover {
  border-color: rgba(167, 139, 250, 0.45);
  background: #2c2c2c;
  transform: translateY(-2px);
  opacity: 1;
}
.card .card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.card .arrow { color: var(--text-faint); transition: transform .2s ease, color .2s ease; }
.card:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }
.card p { font-size: .92rem; line-height: 1.6; margin: 0; color: var(--text-dim); }

/* non-link card variant */
.card-static {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.card-static h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  margin-bottom: 8px;
}
.card-static p { font-size: .92rem; line-height: 1.6; color: var(--text-dim); }
.card-static p + p { margin-top: 10px; }

.tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: .7rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(167, 139, 250, 0.22);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Status pill ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: .7rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(167, 139, 250, 0.22);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------- DNA art ---------- */
.hero-dna {
  flex: 0 0 auto;
  margin-left: auto;
  opacity: 0.72;
}
@media (max-width: 560px) { .hero-dna { display: none; } }

/* ---------- Project page ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.back-link:hover { color: var(--accent); opacity: 1; }

.meta-line {
  font-size: .9rem;
  color: var(--text-dim);
  margin-top: 6px;
}
.meta-line .authors { color: var(--text); }

.pill-links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .82rem;
  color: var(--text-dim);
  transition: border-color .18s ease, color .18s ease;
}
.pill-link:hover { border-color: rgba(167, 139, 250, 0.45); color: var(--text); opacity: 1; }

.prose p { color: var(--text-dim); font-size: .98rem; }
.prose p + p { margin-top: 16px; }
.prose strong { color: var(--text); font-weight: 600; }

.tldr {
  background: var(--accent-dim);
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.tldr p { color: var(--text); margin: 0; font-size: .98rem; line-height: 1.6; }

/* Figures */
.figure {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px 18px;
  margin-top: 8px;
}
.figure svg, .figure img { display: block; max-width: 100%; margin: 0 auto; }
.figure img { border-radius: 8px; }
.figcaption {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-faint);
  line-height: 1.55;
}
.figcaption b { color: var(--text-dim); font-weight: 600; }

/* Stat callouts */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat .num {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--accent);
}
.stat .lbl { margin-top: 4px; font-size: .82rem; color: var(--text-dim); line-height: 1.45; }

/* ---------- Footer ---------- */
footer {
  padding: 40px 0 60px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
