/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --accent: #00d4ff;
  --accent-hover: #00b8d9;
  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --text-white: #ffffff;
  --border-color: #2a2a4a;
  --nav-height: 70px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', monospace;
  --transition: 0.3s ease;
}

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

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

/* ========================================
   Container
   ======================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Navigation
   ======================================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
}

.nav-menu {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-white);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 6px 0;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  position: relative;
}

.hero-content {
  max-width: 700px;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-typing {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 24px;
  min-height: 2rem;
}

.typing-cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent);
  font-weight: 300;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-outline {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

/* Scroll indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: float 2s ease-in-out infinite;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg);
}

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

/* ========================================
   Sections (common)
   ======================================== */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-white);
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ========================================
   About Section
   ======================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.about-social {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.about-social a {
  color: var(--text-secondary);
  transition: all var(--transition);
}

.about-social a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.about-social svg {
  width: 22px;
  height: 22px;
}

.about-details h3 {
  font-size: 1.1rem;
  color: var(--text-white);
  margin-bottom: 16px;
  font-weight: 600;
}

/* Skills */
.skills-section {
  margin-bottom: 36px;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  padding: 6px 14px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  transition: all var(--transition);
}

.skill-tag:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
}

.timeline-content h4 {
  font-size: 1rem;
  color: var(--text-white);
  margin: 4px 0;
  font-weight: 600;
}

.timeline-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ========================================
   Projects Section
   ======================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 28px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 10px 40px rgba(0, 212, 255, 0.1);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.project-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
}

.project-link svg {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.project-link:hover svg {
  color: var(--text-white);
}

.project-title {
  font-size: 1.2rem;
  color: var(--text-white);
  margin-bottom: 12px;
  font-weight: 600;
}

.project-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  flex-grow: 1;
  margin-bottom: 20px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  font-size: 0.8rem;
  color: var(--accent);
  font-family: var(--font-mono);
}

.project-tags span:not(:last-child)::after {
  content: ' \00b7';
  color: var(--text-secondary);
  margin-left: 8px;
}

/* ========================================
   Publications Section
   ======================================== */
.pub-section-heading {
  max-width: 800px;
  margin: 0 auto 24px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.publications-list {
  max-width: 800px;
  margin: 0 auto 40px;
}

.publication-item {
  display: flex;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 20px;
  transition: all var(--transition);
  background: rgba(26, 26, 46, 0.3);
}

.publication-item:hover {
  border-color: var(--accent);
  background: rgba(26, 26, 46, 0.6);
}

.pub-year {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  white-space: nowrap;
  padding-top: 2px;
}

.pub-title a {
  font-size: 1.05rem;
  color: var(--text-white);
  font-weight: 600;
  transition: color var(--transition);
}

.pub-title a:hover {
  color: var(--accent);
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 6px 0;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
}

.pub-github-link {
  color: var(--text-secondary);
  margin-left: 6px;
  vertical-align: middle;
  transition: color 0.3s ease;
}

.pub-github-link:hover {
  color: var(--accent);
}

.pub-github-link svg {
  vertical-align: middle;
}

.pub-links {
  display: flex;
  gap: 12px;
}

.pub-link {
  font-size: 0.8rem;
  padding: 4px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--accent);
  transition: all var(--transition);
}

.pub-link:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent);
}

/* ========================================
   Footer
   ======================================== */
#footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  color: var(--text-secondary);
  transition: all var(--transition);
}

.footer-social a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-social svg {
  width: 22px;
  height: 22px;
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========================================
   Scroll Reveal Animation
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    padding: 24px 0;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
  }

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

  .nav-link {
    display: block;
    padding: 16px 24px;
    font-size: 1rem;
  }

  .nav-link::after {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .publication-item {
    flex-direction: column;
    gap: 8px;
  }

  .hero-scroll-indicator {
    display: none;
  }

  .section {
    padding: 70px 0;
  }

  .section-title {
    margin-bottom: 40px;
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: 2.2rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 240px;
    text-align: center;
  }

  .project-card {
    padding: 20px;
  }

  .publication-item {
    padding: 20px;
  }
}
