/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --navy-900: #0b1220;
  --navy-800: #101a2e;
  --navy-700: #17233d;
  --gold: #d9a441;
  --gold-soft: #e8c184;
  --bg: #fafaf8;
  --surface: #ffffff;
  --border: #e6e4df;
  --text: #1c1e22;
  --muted: #5b6270;
  --muted-soft: #8b909b;
  --max-width: 880px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: inherit; }

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

/* ============================================================
   Hero (home page)
   ============================================================ */
.hero {
  position: relative;
  background: radial-gradient(ellipse at top, var(--navy-700) 0%, var(--navy-900) 70%);
  color: #f4f5f7;
  padding: 72px 0 56px;
  overflow: hidden;
}

/* faint starfield, no image assets needed */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 80% 15%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 60% 40%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at 30% 65%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 90% 70%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 45% 85%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 20% 90%, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  text-align: center;
}

.avatar {
  width: 152px;
  height: 152px;
  border-radius: 50%;
  object-fit: cover;
  background: #22314e;
  border: 3px solid rgba(217, 164, 65, 0.55);
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 2.1rem;
  color: #ffffff;
}

.hero .tagline {
  margin: 0 0 18px;
  color: var(--gold-soft);
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.hero .intro {
  max-width: 560px;
  margin: 0 auto;
  color: #c9cedb;
  font-size: 0.98rem;
}

/* ============================================================
   Section cards grid (home page)
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 44px 0 56px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(217, 164, 65, 0.5);
}

.card .icon {
  width: 34px;
  height: 34px;
  color: var(--gold);
}

.card h2 {
  margin: 0;
  font-size: 1.08rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================================================
   Top nav (sub-pages)
   ============================================================ */
.topnav {
  background: var(--navy-900);
  color: #f4f5f7;
}

.topnav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  flex-wrap: wrap;
}

.topnav .brand {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  color: #ffffff;
}

.topnav nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.topnav nav a {
  text-decoration: none;
  color: #b9c0cf;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.topnav nav a:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.06);
}

.topnav nav a.active {
  color: var(--gold-soft);
  background: rgba(217, 164, 65, 0.12);
}

/* ============================================================
   Page content (sub-pages)
   ============================================================ */
main.page {
  padding-top: 48px;
  padding-bottom: 24px;
}

main.page h1 {
  font-size: 1.7rem;
  margin: 0 0 6px;
}

main.page .page-sub {
  color: var(--muted-soft);
  margin: 0 0 32px;
  font-size: 0.95rem;
}

main.page section {
  margin-bottom: 36px;
}

main.page h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
}

main.page p {
  margin: 0 0 14px;
}

main.page code {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.88em;
  background: #f2f4f8;
  padding: 1px 5px;
  border-radius: 5px;
}

.note {
  color: var(--muted-soft);
  font-size: 0.88rem;
  font-style: italic;
}

.pipeline-figure {
  margin: 24px 0 30px;
  padding: 0;
}
.pipeline-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.pipeline-figure figcaption {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--muted-soft);
  text-align: center;
}

.figure-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 24px 0 30px;
  flex-wrap: wrap;
}
.figure-row-img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.figure-row-text {
  flex: 1;
  min-width: 240px;
}
.figure-row-text p {
  margin: 0;
}

/* Buttons / link chips */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-900);
  color: #ffffff !important;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.92rem;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--navy-700); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text) !important;
  text-decoration: none;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-outline:hover { border-color: var(--gold); color: #a15c00 !important; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 18px;
}

/* Publications list */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pub-list li {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.pub-list li:first-child { border-top: none; }
.pub-title {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.pub-authors, .pub-venue {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}
.pub-venue { margin-top: 2px; }
.pub-list a { color: #1d4ed8; text-decoration: none; }
.pub-list a:hover { text-decoration: underline; }

/* Profile links grid */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.profile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.profile-link:hover {
  border-color: var(--gold);
  background: #fffaf1;
}
.profile-link .icon {
  width: 20px;
  height: 20px;
  color: var(--gold);
  flex-shrink: 0;
}
.profile-link .label {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
}
.profile-link .sub {
  color: var(--muted-soft);
  font-size: 0.8rem;
  display: block;
}

/* Contact list */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-list li {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
.contact-list li:first-child { border-top: none; }
.contact-list a { color: #1d4ed8; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

/* Keywords */
.keywords {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.keywords li {
  background: #f2f4f8;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
}

/* Education / CV entries */
.entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.entry:first-child { border-top: none; }
.entry .entry-main strong { display: block; font-size: 0.98rem; }
.entry .entry-main span { color: var(--muted); font-size: 0.88rem; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 44px;
  color: var(--muted-soft);
  font-size: 0.85rem;
  text-align: center;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 40px; }
  .hero h1 { font-size: 1.7rem; }
  .topnav .wrap { flex-direction: column; align-items: flex-start; }
}
