:root {
  --bg: #06080f;
  --bg2: #0c1020;
  --bg3: #111827;
  --surface: #161d2e;
  --surface2: #1e2940;
  --border: rgba(100,140,255,0.12);
  --border2: rgba(100,140,255,0.22);
  --text: #e8edf8;
  --muted: #7a8baa;
  --accent: #4f8aff;
  --accent2: #7c5cfc;
  --accent3: #00d4aa;
  --font-display: 'DM Serif Display', serif;
  --font-body: 'Cabinet Grotesk', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── Stars ── */
#stars-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  opacity: 0.6;
}

/* ── Nav ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 3rem;
  background: rgba(6,8,15,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-cta {
  background: transparent;
  border: 0.5px solid var(--accent);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.nav-cta:hover { background: var(--accent); color: #fff; }

/* ── Layout ── */
main { position: relative; z-index: 1; }
section {
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 3rem;
}

/* ── Section labels ── */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: #fff;
  line-height: 1.1;
  margin-bottom: 3rem;
}

/* ── Hero ── */
.hero-section {
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 8rem 3rem 4rem;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent3);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 8px var(--accent3);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 1.0;
  color: #fff;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s forwards;
}
.hero-name em { color: var(--accent); font-style: italic; }

.hero-tagline {
  font-size: 1.15rem;
  color: var(--muted);
  margin-top: 1.5rem;
  max-width: 560px;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s forwards;
  line-height: 1.75;
}

.hero-cta {
  display: flex; gap: 1rem; margin-top: 3rem; flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  display: inline-block;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(79,138,255,0.35); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 0.5px solid var(--border2);
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  display: inline-block;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-scroll {
  position: absolute;
  bottom: 3rem; left: 3rem;
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  animation: fadeUp 0.8s 1.2s forwards;
}
.scroll-line { width: 40px; height: 0.5px; background: var(--muted); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Page hero (non-home) ── */
.page-hero {
  padding: 9rem 3rem 4rem;
  max-width: 900px;
  margin: 0 auto;
  position: relative; z-index: 1;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  color: #fff;
  margin-bottom: 1rem;
}
.page-hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.75;
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-text p { color: var(--muted); margin-bottom: 1rem; line-height: 1.8; }
.about-text p strong { color: var(--text); }

.about-facts { display: flex; flex-direction: column; gap: 1rem; }
.fact {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.fact-icon { font-size: 1.4rem; width: 36px; text-align: center; }
.fact-label { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.fact-value { font-size: 14px; color: var(--text); font-weight: 500; }

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.skill-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.skill-card h4 {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  background: var(--bg3);
  border: 0.5px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

/* ── Timeline ── */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0.5px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2), transparent);
}
.timeline-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 3rem;
}
.timeline-dot {
  position: absolute;
  left: -4px; top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(79,138,255,0.5);
}
.timeline-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.timeline-role {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.timeline-org {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.timeline-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.timeline-desc li { margin-left: 1.25rem; margin-bottom: 0.25rem; }

/* ── Project cards ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.3s;
}
.project-card:hover { border-color: var(--border2); transform: translateY(-4px); }
.project-card:hover::before { opacity: 1; }
.project-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent3);
  background: rgba(0,212,170,0.08);
  border: 0.5px solid rgba(0,212,170,0.2);
  padding: 2px 8px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}
.project-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.project-card p { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ── Publication ── */
.pub-card {
  background: var(--surface);
  border: 0.5px solid var(--border2);
  border-radius: 10px;
  padding: 1.75rem;
  display: flex; gap: 1.5rem;
  align-items: flex-start;
}
.pub-year {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent);
  min-width: 60px;
}
.pub-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.pub-journal { font-size: 13px; color: var(--accent3); font-style: italic; }

/* ── Contact ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-link {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
  font-size: 14px;
}
.contact-link:hover { border-color: var(--accent); transform: translateX(4px); }
.contact-icon { font-size: 1.25rem; width: 30px; text-align: center; }
.contact-label { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.contact-value { color: var(--text); font-weight: 500; font-size: 13px; }

/* ── Blog listing ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.blog-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.2s;
  color: inherit;
}
.blog-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.blog-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.blog-card h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.blog-card p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.blog-tag {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent2);
  background: rgba(124,92,252,0.08);
  border: 0.5px solid rgba(124,92,252,0.2);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ── Post ── */
.post-back {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}
.post-back:hover { color: var(--accent); }

.post-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 1rem; }
.post-title-h { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); color: #fff; line-height: 1.1; margin-bottom: 2rem; }

.post-body { color: var(--muted); line-height: 1.9; font-size: 15px; max-width: 680px; }
.post-body p { margin-bottom: 1.25rem; }
.post-body h2 { font-family: var(--font-display); color: var(--text); font-size: 1.5rem; margin: 2.5rem 0 0.75rem; }
.post-body h3 { color: var(--text); font-size: 1.1rem; margin: 2rem 0 0.5rem; }
.post-body strong { color: var(--text); }
.post-body ul, .post-body ol { margin: 0 0 1.25rem 1.5rem; }
.post-body li { margin-bottom: 0.3rem; }
.post-body code {
  background: var(--surface);
  border: 0.5px solid var(--border2);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--accent);
}
.post-body pre {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.post-body pre code { background: none; border: none; padding: 0; color: var(--text); }

/* ── Loading / empty ── */
.loading {
  text-align: center;
  padding: 4rem;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ── Footer ── */
footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  border-top: 0.5px solid var(--border);
}

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s, transform 0.7s; }
.reveal.visible { opacity: 1; transform: none; }

/* ── Responsive ── */
@media (max-width: 700px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .hero-section, section, .page-hero { padding-left: 1.5rem; padding-right: 1.5rem; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .pub-card { flex-direction: column; gap: 0.5rem; }
}
