/* === Custom Styles - Xu Liyao Portfolio === */

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a0b; }
::-webkit-scrollbar-thumb { background: #363639; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #48484a; }

/* Noise overlay */
#noise-overlay {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; opacity: 0.02;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 256px 256px;
}

/* Navigation */
.nav-link {
  position: relative; color: rgba(255,255,255,0.6);
  font-size: 0.9rem; transition: color 0.3s;
  padding: 0.25rem 0;
}
.nav-link::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1.5px; background: #2997ff;
  transition: width 0.3s ease;
}
.nav-link:hover { color: rgba(255,255,255,0.9); }
.nav-link:hover::after { width: 100%; }

.project-card {
  position: relative;
  padding: 28px; border-radius: 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.4s ease;
}

.project-card::before {
  content: '';
  position: absolute; inset: -1px; border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: all 0.5s ease;
  pointer-events: none;
}

.project-card:hover {
  background: rgba(255,255,255,0.04);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.project-card:hover::before {
  background: linear-gradient(135deg, #0071e3, #2997ff, #0071e3, #2997ff);
  background-size: 300% 100%;
  animation: borderGlow 2s ease infinite;
}

@keyframes borderGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Glass card */
.glass-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  transition: all 0.4s ease;
}
.glass-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border-radius: 14px;
  background: #0071e3; color: white; font-weight: 500;
  transition: all 0.3s ease;
}
.btn-primary:hover { background: #2997ff; transform: translateY(-1px); box-shadow: 0 8px 30px rgba(0,113,227,0.3); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border-radius: 14px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.12); font-weight: 500;
  transition: all 0.3s ease;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }

/* Hero section */
.hero-title {
  background: linear-gradient(135deg, #ffffff 0%, #aeaeb2 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}
.hero-subtitle { letter-spacing: -0.01em; }
.hero-badge {
  padding: 6px 16px; border-radius: 100px;
  background: rgba(0,113,227,0.15); border: 1px solid rgba(0,113,227,0.25);
  color: #2997ff; font-size: 0.85rem; font-weight: 500;
  backdrop-filter: blur(10px);
}

/* Section styles */
.section-tag {
  display: inline-block; padding: 6px 16px; border-radius: 100px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5); font-size: 0.85rem; font-weight: 500;
  margin-bottom: 16px; letter-spacing: 0.05em;
}
.section-title {
  font-size: 2.5rem; font-weight: 700; margin-bottom: 16px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #aeaeb2 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
@media (min-width: 768px) { .section-title { font-size: 3.5rem; } }

/* Avatar ring */
.avatar-ring {
  animation: pulseRing 2s ease-in-out infinite;
}
@keyframes pulseRing {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* Stat cards */
.stat-card {
  position: relative; text-align: center;
  padding: 20px 12px; border-radius: 16px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden; transition: all 0.3s ease;
}
.stat-card:hover { border-color: rgba(0,113,227,0.3); transform: translateY(-2px); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, transparent, #0071e3, transparent);
}
.stat-number {
  font-size: 2.5rem; font-weight: 800;
  background: linear-gradient(135deg, #2997ff, #0071e3);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
}
.stat-plus, .stat-unit {
  font-size: 1.5rem; font-weight: 700;
  color: #0071e3; margin-left: 1px;
}
.stat-label { display: block; color: rgba(255,255,255,0.4); font-size: 0.85rem; margin-top: 4px; }

/* Project cards */


.project-tag {
  padding: 4px 12px; border-radius: 8px;
  background: rgba(0,113,227,0.15); color: #2997ff;
  font-size: 0.8rem; font-weight: 500;
}
.project-role {
  padding: 4px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
  font-size: 0.8rem; font-weight: 500;
}
.tech-tag {
  padding: 4px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45); font-size: 0.75rem;
  transition: all 0.3s ease;
}
.tech-tag:hover { border-color: rgba(0,113,227,0.3); color: #2997ff; background: rgba(0,113,227,0.08); }

/* Strength cards */
.strength-card {
  padding: 28px; border-radius: 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.4s ease;
}
.strength-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}
.strength-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; transition: all 0.3s ease;
}
.strength-card:hover .strength-icon { transform: scale(1.1); }

/* Timeline */
.timeline-line {
  position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(180deg, #0071e3, transparent);
}
@media (min-width: 768px) { .timeline-line { left: 11px; } }
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute; left: 0; top: 24px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #0071e3; border: 3px solid #1c1c1e;
  box-shadow: 0 0 12px rgba(0,113,227,0.5);
}
@media (min-width: 768px) { .timeline-dot { width: 24px; height: 24px; left: 0; top: 22px; } }

/* Contact cards */
.contact-card { cursor: pointer; transition: all 0.3s ease; text-decoration: none; }
.contact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,113,227,0.3);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Scroll reveal */
.scroll-reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.scroll-reveal.revealed { opacity: 1; transform: translateY(0); }

/* Mobile menu animation */
#mobileMenu { transition: all 0.3s ease; }
#mobileMenu.show { display: block; }

/* Navbar scroll effect */
.navbar-scrolled {
  background: rgba(10,10,11,0.85) !important;
  backdrop-filter: blur(30px) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 1px 20px rgba(0,0,0,0.3);
}

/* Responsive fine-tuning */
@media (max-width: 640px) {
  .hero-title { font-size: 3rem !important; }
  .section-title { font-size: 2rem !important; }
  .stat-number { font-size: 2rem !important; }
  .project-card { padding: 20px; }
}
