/* =============================================
   Leon Qu Portfolio — Dark ML-Themed Design
   ============================================= */

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

:root {
  --bg-primary: #0a0f1c;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1e2a42;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.3);
  --accent-secondary: #8b5cf6;
  --accent-secondary-glow: rgba(139, 92, 246, 0.3);
  --border: #1e293b;
  --border-hover: #334155;
  --gradient: linear-gradient(135deg, #06b6d4, #8b5cf6);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --nav-height: 70px;
  --container-max: 1100px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

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

a:hover {
  color: #22d3ee;
}

.mono {
  font-family: var(--font-mono);
}

.accent {
  color: var(--accent);
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 60px 0;
  display: flex;
  align-items: center;
}

.hero-section {
  min-height: 100vh;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3.5rem;
  letter-spacing: -0.02em;
}

.section-title .mono {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

/* --- GSAP handles all reveal animations --- */

/* --- Navigation --- */
#navbar {
  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: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  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(--accent);
}

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

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

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

/* --- Hero Section --- */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 4rem;
  max-width: 1100px;
  width: 100%;
  position: relative;
  z-index: 1;
}

#neural-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  flex: 1;
}

/* --- Profile Image --- */
.hero-image-wrapper {
  position: relative;
  flex-shrink: 0;
}

.hero-image {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  position: relative;
  z-index: 1;
  transition: all var(--transition);
}

.hero-image:hover {
  border-color: var(--accent);
  transform: scale(1.03);
}

.hero-image-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
  animation: ring-rotate 8s linear infinite;
}

@keyframes ring-rotate {
  to { transform: rotate(360deg); }
}

.hero-greeting {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.hero-name {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero-typing-wrapper {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  min-height: 1.8em;
}

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

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

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
  max-width: 560px;
}

.hero-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-location .fa {
  color: var(--accent);
  margin-right: 0.3em;
}

.hero-socials {
  display: flex;
  gap: 1rem;
}

.social-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition);
}

.social-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: float 3s ease-in-out infinite;
  z-index: 1;
}

.scroll-indicator span {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.mouse {
  width: 22px;
  height: 34px;
  border: 2px solid var(--text-muted);
  border-radius: 11px;
  position: relative;
}

.wheel {
  width: 3px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.3; transform: translateX(-50%) translateY(8px); }
}

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

/* --- Projects --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.project-icon {
  font-size: 1.8rem;
  color: var(--accent);
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 20px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.project-tech {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.project-tech li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(6, 182, 212, 0.08);
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
}

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

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-secondary), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}

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

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  transform: translateX(-5px);
  z-index: 1;
  transition: all var(--transition);
}

.timeline-item:hover .timeline-marker {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

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

.timeline-item:hover .timeline-content {
  border-color: var(--border-hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.timeline-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.timeline-company {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-details {
  list-style: none;
}

.timeline-details li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.7;
}

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

/* --- Education --- */
.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all var(--transition);
}

.edu-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.edu-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.edu-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.edu-degrees {
  margin-bottom: 1rem;
}

.edu-degree {
  margin-bottom: 0.75rem;
}

.edu-field {
  display: block;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
}

.edu-type {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

/* --- Skills --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: all var(--transition);
}

.skill-category:hover {
  border-color: var(--border-hover);
}

.skill-category-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.skill-category-title .fa {
  color: var(--accent);
  margin-right: 0.5rem;
}

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

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  background: rgba(6, 182, 212, 0.05);
  transition: all var(--transition);
  cursor: default;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(6, 182, 212, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* --- Awards --- */
.awards-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.award-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  transition: all var(--transition);
}

.award-item:hover {
  border-color: var(--border-hover);
  transform: translateX(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.award-icon {
  font-size: 1.5rem;
  color: #fbbf24;
  flex-shrink: 0;
}

.award-content h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

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

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

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 15, 28, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .section {
    padding: 50px 0;
  }

  .hero-section {
    min-height: 100vh;
    padding: 0 1.5rem;
  }

  .hero-inner {
    flex-direction: column-reverse;
    gap: 2rem;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .hero-bio {
    max-width: 100%;
  }

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

  .hero-image {
    width: 180px;
    height: 180px;
  }

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

  .hero-name {
    font-size: 2.5rem;
  }

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

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

  .container {
    padding: 0 1.5rem;
  }

  .award-item {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
}

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

  .section-title {
    font-size: 1.5rem;
  }

  .project-card,
  .timeline-content,
  .edu-card,
  .skill-category,
  .award-item {
    padding: 1.25rem;
  }
}
