:root {
  --bg: #0f1115;
  --bg-soft: #161a22;
  --bg-card: #1c212c;
  --border: #2a3140;
  --text: #e7eaf0;
  --text-muted: #9aa3b2;
  --primary: #6366f1;
  --primary-2: #22d3ee;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

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

section {
  padding: 96px 0;
}

.section-title {
  font-size: 2rem;
  text-align: center;
  letter-spacing: 1px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 6px 0 48px;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 4px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(15, 17, 21, 0.8);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.85rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

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

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

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

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

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

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(99, 102, 241, 0.16), transparent 70%),
    radial-gradient(600px 300px at 80% 10%, rgba(34, 211, 238, 0.12), transparent 70%);
}

.avatar {
  width: 128px;
  height: 128px;
  margin: 0 auto 28px;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.avatar svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  background: var(--bg);
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.3;
}

.hero-tagline {
  margin-top: 12px;
  font-size: 1.2rem;
  color: var(--primary-2);
  font-weight: 500;
}

.hero-desc {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 48px;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hero-meta li {
  position: relative;
  padding-left: 18px;
}

.hero-meta li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.45);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

/* ---------- About ---------- */
.about {
  background: var(--bg-soft);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-text strong {
  color: var(--text);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.about-tags span {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
  color: var(--primary-2);
}

.about-facts {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.about-facts li {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text);
}

.about-facts li:last-child {
  border-bottom: none;
}

.about-facts li span {
  color: var(--text-muted);
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  transition: transform 0.25s, border-color 0.25s;
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
}

.skill-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(34, 211, 238, 0.2));
  color: var(--primary-2);
  margin-bottom: 18px;
}

.skill-icon svg {
  width: 26px;
  height: 26px;
}

.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.skill-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.project-cover {
  height: 140px;
  background:
    linear-gradient(135deg, var(--cover, #6366f1), transparent 70%),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.25), transparent 40%);
}

.project-body {
  padding: 24px;
}

.project-body h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.project-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

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

.project-tags span {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  font-size: 0.8rem;
}

.project-link {
  color: var(--primary-2);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.2s;
}

.project-link:hover {
  color: #67e8f9;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--bg-soft);
  text-align: center;
}

.contact-intro {
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto 36px;
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
  gap: 8px;
}

.site-footer a:hover {
  color: var(--primary-2);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 640px) {
  section {
    padding: 72px 0;
  }

  .hero {
    padding: 72px 0 56px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

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

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(15, 17, 21, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    gap: 4px;
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    z-index: 40;
  }

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

  .nav-links li a {
    display: block;
    padding: 12px 4px;
  }

  .nav-toggle {
    display: flex;
  }
}
