/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  --bg: #0a0f1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2236;
  --accent: #00d4aa;
  --accent-dim: rgba(0,212,170,0.15);
  --accent-glow: rgba(0,212,170,0.3);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: #1e293b;
  --white: #f8fafc;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
::selection { background: var(--accent-glow); color: var(--white); }

/* ===== ANIMATIONS ===== */
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes slideDown { 0%{transform:translateY(-8px);opacity:0} 50%{opacity:1;transform:translateY(0)} 100%{transform:translateY(8px);opacity:0} }
@keyframes fadeUp { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== NAV RAIL ===== */
.nav-rail {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}
.nav-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-dot-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.3s ease;
}
.nav-dot.active .nav-dot-inner {
  background: var(--accent);
  width: 10px;
  height: 10px;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 60px 40px;
  position: relative;
  background: radial-gradient(ellipse at 20% 50%, rgba(0,212,170,0.06) 0%, transparent 60%), var(--bg);
}
.hero-grid {
  display: flex;
  gap: 60px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex-wrap: wrap;
}
.hero-left, .hero-right { flex: 1; min-width: 320px; }

.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  animation: fadeUp 0.8s ease both;
}
.hero-name {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: -2px;
  animation: fadeUp 0.8s ease 0.15s both;
}
.hero-name .accent { color: var(--accent); }
.hero-sub {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
  animation: fadeUp 0.8s ease 0.3s both;
}
.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeUp 0.8s ease 0.45s both;
}
.btn-primary {
  padding: 14px 32px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-block;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-outline {
  padding: 14px 32px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
  display: inline-block;
}
.btn-outline:hover {
  background: var(--accent-dim);
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: slideDown 2s ease infinite;
}

/* ===== TERMINAL ===== */
.terminal {
  background: #0d1117;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px var(--accent-dim);
  animation: fadeUp 0.8s ease 0.5s both;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #161b22;
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.terminal-title {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 8px;
  font-family: var(--font-mono);
}
.terminal-body {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.8;
  min-height: 180px;
}
.term-cmd { color: var(--accent); }
.term-output { color: var(--text-muted); }
.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

/* ===== SECTIONS ===== */
.section {
  padding: 100px 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.section-label {
  font-size: 12px;
  letter-spacing: 4px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 48px;
  letter-spacing: -1px;
}

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 28px;
  text-align: center;
  transition: border-color 0.3s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  transition: border-color 0.3s;
}
.skill-group:hover { border-color: var(--accent); }
.skill-category {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-family: var(--font-mono);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  font-size: 13px;
  padding: 5px 14px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s;
}
.skill-tag:hover { background: var(--accent-glow); }

/* ===== PROJECTS ===== */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 40px;
  transition: all 0.3s ease;
}
.project-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 30px var(--accent-dim);
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.project-period {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-status-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  padding: 1px 7px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.project-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}
.project-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}
.project-links { display: flex; gap: 12px; flex-wrap: wrap; }
.project-link {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: color 0.2s, border-color 0.2s;
}
.project-link:hover { color: var(--accent); border-color: var(--accent); }
.project-link-accent {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  transition: background 0.2s;
}
.project-link-accent:hover { background: var(--accent-dim); }
.project-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.project-highlights {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.highlight {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.highlight-dot {
  color: var(--accent);
  margin-right: 8px;
  font-weight: 700;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.project-tag {
  font-size: 11px;
  padding: 4px 12px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-weight: 500;
}

/* ===== TIMELINE ===== */
.timeline {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--border);
  margin-left: 16px;
  padding-left: 32px;
}
.timeline-item {
  position: relative;
  padding-bottom: 40px;
}
.timeline-dot {
  position: absolute;
  left: -41px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.timeline-period {
  font-size: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}
.timeline-role {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.timeline-org {
  font-size: 15px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2px;
}
.timeline-location {
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== EDUCATION ===== */
.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 32px;
  margin-top: 16px;
  transition: border-color 0.3s;
}
.edu-card:hover { border-color: var(--accent); }
.edu-degree { font-size: 18px; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.edu-school { font-size: 15px; color: var(--text-muted); font-style: italic; margin-bottom: 4px; }
.edu-period { font-size: 13px; color: var(--text-dim); font-family: var(--font-mono); }

/* ===== RESEARCH ===== */
.research-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 32px;
  margin-top: 16px;
  border-left: 3px solid var(--accent);
  transition: border-color 0.3s;
}
.research-card:hover { border-color: var(--accent); }
.research-title { font-size: 16px; font-weight: 600; color: var(--white); margin-bottom: 6px; font-style: italic; }
.research-authors { font-size: 14px; color: var(--text-muted); margin-bottom: 4px; }
.research-venue { font-size: 13px; color: var(--text-dim); font-family: var(--font-mono); }

/* ===== CONTACT ===== */
.contact-section { text-align: center; }
.contact-sub {
  font-size: 17px;
  color: var(--text-muted);
  margin-top: -32px;
  margin-bottom: 48px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s ease;
  display: block;
}
.contact-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.contact-icon {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-mono);
}
.contact-label-text {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}
.contact-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 60px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}
.footer-dot { margin: 0 10px; color: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 60px 24px 40px; }
  .hero-grid { flex-direction: column; gap: 40px; }
  .hero-left, .hero-right { min-width: unset; width: 100%; }
  .section { padding: 60px 24px; }
  .project-card { padding: 24px 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-rail { right: 10px; }
  .footer { padding: 24px; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .hero-name { letter-spacing: -1px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 24px 16px; }
  .stat-number { font-size: 36px; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .project-header { flex-direction: column; }
}
