/* === Variables === */
:root {
  --bg-primary: #0a0a14;
  --bg-card: #12121f;
  --bg-alt: #0e0e1a;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-teal: #22d3ee;
  --border: rgba(255, 255, 255, 0.06);
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --nav-height: 64px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

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

.section {
  padding: 96px 0;
}

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

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 48px;
  text-align: center;
  letter-spacing: -0.02em;
}

/* === Navigation === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.nav-logo:hover {
  color: var(--accent-hover);
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

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

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

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

.nav-overlay.active {
  display: block;
}

/* === Hero === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(59, 130, 246, 0.08) 0%, transparent 70%),
    var(--bg-primary);
}

.hero-content {
  animation: fadeInUp 0.8s ease-out both;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 8px;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  color: var(--text-secondary);
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 8px;
}

.hero-sep {
  color: var(--text-secondary);
  opacity: 0.5;
}

.hero-links {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.hero-links a {
  color: var(--text-secondary);
  transition: color 0.2s, transform 0.2s;
}

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

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

/* === About (in hero) === */
.hero-about {
  max-width: 600px;
  margin: 48px auto 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  opacity: 0.7;
  text-align: center;
  animation: fadeInUp 0.8s 0.3s ease-out both;
}

/* === Press Gallery === */
.press-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.press-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

.press-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}

.press-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.press-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.press-card:hover .press-image img {
  transform: scale(1.03);
}

.press-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
}

.press-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.press-body h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.press-body time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: auto;
}

/* === Video === */
.video-wrap {
  max-width: 800px;
  margin: 0 auto;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-caption {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 16px;
  font-style: italic;
}

/* === Experience Timeline === */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 40px;
}

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

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

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

.timeline-dot {
  position: absolute;
  left: -33px;
  top: 24px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.section-alt .timeline-dot {
  border-color: var(--bg-alt);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color 0.3s;
}

.timeline-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
}

.timeline-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.timeline-role {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-hover);
  margin-top: 16px;
  margin-bottom: 8px;
}

.timeline-card ul {
  padding-left: 20px;
  list-style: disc;
}

.timeline-card li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
}

.timeline-patents {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* === Publications === */
.pub-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color 0.3s;
  position: relative;
}

.pub-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
}

.pub-featured {
  border-left: 3px solid var(--accent);
}

.pub-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.pub-image {
  width: 66%;
  border-radius: 8px;
  margin: 0 auto 16px;
  mix-blend-mode: lighten;
}

.pub-image-light {
  mix-blend-mode: normal;
  border-radius: 8px;
}

.pub-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.pub-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

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

.pub-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
}

/* === Patents === */
.patent-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.patent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.3s;
}

.patent-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
}

.patent-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.patent-granted {
  color: var(--accent-teal);
  background: rgba(34, 211, 238, 0.1);
}

.patent-application {
  color: var(--text-secondary);
  background: rgba(136, 136, 160, 0.1);
}

.patent-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.patent-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* === Education === */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}

.edu-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

.edu-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.edu-degree {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.edu-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.edu-year {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* === Footer === */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--accent);
}

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

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

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

/* === Responsive === */

/* Tablet */
@media (max-width: 1024px) {
  .press-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .section {
    padding: 64px 0;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 32px;
  }

  /* Nav mobile */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    border-left: 1px solid var(--border);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1rem;
  }

  /* Hero mobile */
  .hero-title,
  .hero-tagline {
    flex-direction: column;
    gap: 4px;
  }

  .hero-sep {
    display: none;
  }

  /* Press */
  .press-grid {
    grid-template-columns: 1fr;
  }

  /* Timeline */
  .timeline {
    padding-left: 32px;
  }

  .timeline::before {
    left: 11px;
  }

  .timeline-dot {
    left: -28px;
  }

  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }

  .timeline-card {
    padding: 20px;
  }

  /* Education */
  .edu-grid {
    grid-template-columns: 1fr;
  }
}
