:root {
  --bg: #0b0f1a;
  --bg-soft: #121828;
  --card: #151c2e;
  --border: #232b45;
  --text: #e6eaf5;
  --text-dim: #9aa4c0;
  --accent-1: #6366f1;
  --accent-2: #22d3ee;
  --accent-3: #a78bfa;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.18),
    rgba(34, 211, 238, 0.08) 45%,
    transparent 70%
  );
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 96px 24px 64px;
}

.avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
  user-select: none;
}

.hero-name {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-1), var(--accent-3));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 6s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.hero-title {
  margin-top: 10px;
  font-size: 18px;
  color: var(--accent-2);
  font-weight: 500;
}

.hero-desc {
  max-width: 520px;
  margin: 16px auto 28px;
  color: var(--text-dim);
  font-size: 15px;
}

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

.hero-links a {
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(21, 28, 46, 0.6);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.hero-links a:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.15);
}

/* Projects */
.container {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.projects {
  padding-top: 24px;
}

.section-title {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
}

.section-sub {
  text-align: center;
  color: var(--text-dim);
  margin: 8px 0 40px;
  font-size: 15px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.18);
  transform: translateY(-4px);
}

.project-thumb {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

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

.project-title {
  font-size: 18px;
  font-weight: 600;
}

.project-desc {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 14px;
  flex: 1;
}

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

.project-tags span {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.project-link {
  margin-top: 16px;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.project-link:hover {
  color: var(--accent-3);
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 24px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* Reveal animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero.animate > * {
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}

.hero.animate > *:nth-child(1) { animation-delay: 0.05s; }
.hero.animate > *:nth-child(2) { animation-delay: 0.15s; }
.hero.animate > *:nth-child(3) { animation-delay: 0.25s; }
.hero.animate > *:nth-child(4) { animation-delay: 0.35s; }
.hero.animate > *:nth-child(5) { animation-delay: 0.45s; }

@media (max-width: 640px) {
  .hero-name {
    font-size: 30px;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}
