:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #6366f1;
  --primary-soft: #eef2ff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --max-w: 1080px;
}

* {
  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;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.nav--scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

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

.nav__brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  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.3s, opacity 0.3s;
}

/* ---------- Hero ---------- */
.hero {
  padding: 160px 0 100px;
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--bg) 100%);
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: 64px;
}

.hero__text {
  flex: 1;
}

.hero__eyebrow {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
}

.hero__title {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero__desc {
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero__actions {
  display: flex;
  gap: 14px;
}

.hero__avatar {
  position: relative;
  width: 300px;
  height: 300px;
  flex-shrink: 0;
}

.hero__avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--primary), #22d3ee, var(--primary));
  animation: spin 8s linear infinite;
}

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

.hero__avatar-inner {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__avatar-emoji {
  font-size: 6rem;
}

/* ---------- Section base ---------- */
.section {
  padding: 96px 0;
}

.section__eyebrow {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.section__title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

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

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about__card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s, box-shadow 0.25s;
}

.about__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.about__card h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

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

/* ---------- Skills ---------- */
.skills__wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skills__group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
}

.skills__group h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.skills__list {
  list-style: none;
}

.skills__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.95rem;
}

.skills__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* ---------- Products ---------- */
.products__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.product {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.product:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.product__logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 15%, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.product__name {
  font-size: 1.1rem;
}

.product__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex: 1;
}

.product__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tag {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.product__link {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
}

.product__link:hover {
  text-decoration: underline;
}

/* ---------- Projects ---------- */
.projects {
  background: var(--bg-soft);
}

.projects__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 28px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.project:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.project__name {
  font-size: 1.05rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-bottom: 4px;
}

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

.project__stat {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---------- Contact ---------- */
.contact__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact__desc {
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 420px;
}

.contact__actions {
  display: flex;
  gap: 14px;
  margin-bottom: 48px;
}

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

.contact__social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 40px;
}

.social-link {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

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

.btn--ghost {
  cursor: pointer;
  font-family: inherit;
}

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

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

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

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

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero__desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__avatar {
    width: 220px;
    height: 220px;
  }

  .about__grid,
  .skills__wrap,
  .products__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .nav__links.open {
    display: flex;
  }

  .nav__links a {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
  }

  .nav__toggle {
    display: flex;
  }

  .hero {
    padding: 130px 0 70px;
  }

  .hero__title {
    font-size: 2.4rem;
  }

  .section {
    padding: 64px 0;
  }
}
