/* ── Design tokens ── */
:root {
  --bg: #0a0b0f;
  --bg-alt: #111218;
  --bg-card: #16171f;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e6e3;
  --text-muted: #8b8d98;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.15);
  --accent-glow: rgba(74, 222, 128, 0.25);
  --warm: #fbbf24;
  --font-display: 'Syne', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --radius: 12px;
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background effects ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: rgba(74, 222, 128, 0.07);
  top: -200px;
  right: -150px;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: rgba(251, 191, 36, 0.05);
  bottom: 10%;
  left: -200px;
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
  position: relative;
  z-index: 1;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin-top: 0.75rem;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  background: rgba(10, 11, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav.scrolled {
  background: rgba(10, 11, 15, 0.95);
}

.nav-logo {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.2s;
}

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

.nav-cta {
  color: var(--accent) !important;
  border: 1px solid var(--accent-dim);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s !important;
}

.nav-cta:hover {
  background: var(--accent-dim);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  padding: calc(var(--nav-height) + 3rem) 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.1s forwards;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.2s forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.35s forwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.45s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s 0.55s forwards;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  max-width: 140px;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 1s 0.6s forwards;
}

.hero-portrait-wrap {
  position: relative;
  width: min(380px, 90vw);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-portrait-glow {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(24px);
  z-index: 0;
  animation: pulse 4s ease-in-out infinite;
}

.hero-portrait-ring {
  position: absolute;
  inset: -3%;
  border-radius: 50%;
  border: 1px solid rgba(74, 222, 128, 0.35);
  z-index: 2;
  pointer-events: none;
}

.hero-portrait-ring::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(74, 222, 128, 0.12);
}

.hero-portrait {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 50%;
  border: 3px solid rgba(74, 222, 128, 0.2);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: float 6s ease-in-out infinite;
}

.network-graph {
  width: 100%;
  max-width: 380px;
  color: var(--accent);
}

.network-graph-overlay {
  position: absolute;
  inset: -8%;
  max-width: none;
  width: 116%;
  height: 116%;
  pointer-events: none;
  z-index: 3;
  opacity: 0.55;
  animation: float 6s ease-in-out infinite reverse;
}

.network-graph svg {
  width: 100%;
  height: 100%;
}

.node-center {
  animation: pulse 3s ease-in-out infinite;
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text .lead {
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.highlight-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.highlight-card:hover {
  border-color: var(--accent-dim);
  transform: translateX(4px);
}

.highlight-icon {
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

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

.highlight-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.highlight-card strong {
  color: var(--text);
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s, transform 0.5s;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--accent);
  transform: translateX(-50%);
  margin-left: 6px;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s;
}

.timeline-content:hover {
  border-color: rgba(74, 222, 128, 0.2);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.timeline-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.company {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.15rem;
}

.timeline-header time {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.timeline-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.timeline-content li {
  font-size: 0.925rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.6;
}

.timeline-content li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
}

.timeline-content strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Research & Education ── */
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 2.5rem;
  align-items: start;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
}

.edu-degree {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.edu-school {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.edu-detail {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.edu-thesis {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.publications h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.pub-list {
  list-style: none;
  counter-reset: pub;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub-list li {
  counter-increment: pub;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 2rem;
  position: relative;
}

.pub-list li::before {
  content: counter(pub, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent);
  top: 2px;
}

.pub-list em {
  color: var(--text);
  font-style: italic;
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skill-group h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags span {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}

.tags span:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

/* ── Contact ── */
.contact-section {
  text-align: center;
}

.contact-lead {
  color: var(--text-muted);
  max-width: 520px;
  margin: -1.5rem auto 2.5rem;
  font-size: 1.05rem;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-align: left;
}

.contact-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.contact-card-static {
  cursor: default;
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.contact-value {
  font-size: 0.875rem;
  color: var(--text);
  word-break: break-all;
}

/* ── Footer ── */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

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

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: calc(var(--nav-height) + 2rem);
    text-align: center;
  }

  .hero-tagline,
  .hero-actions,
  .hero-stats {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
    margin-bottom: 1rem;
  }

  .hero-portrait-wrap {
    width: min(260px, 70vw);
  }

  .about-grid,
  .research-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .edu-card {
    position: static;
  }

  .contact-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 11, 15, 0.98);
    padding: 1.5rem 2rem 2rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .contact-links {
    grid-template-columns: 1fr;
  }

  .timeline-header {
    flex-direction: column;
  }
}
