:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #1a1a2e;
  --text-soft: #5b5b70;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --border: #e6e8ee;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(26, 26, 46, 0.06);
  --max-w: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 40%, #f0f8ff 70%, #ffffff 100%);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
  text-decoration: none;
}

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

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

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

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

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

/* ---------- Hero ---------- */
.hero {
  padding: 110px 0 80px;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(79, 70, 229, 0.1), transparent 60%),
    radial-gradient(700px 350px at 10% 0%, rgba(236, 72, 153, 0.08), transparent 55%);
}

.hero-inner {
  max-width: 760px;
}

.hero-eyebrow {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.hero-subtitle {
  margin-top: 16px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.hero-desc {
  margin-top: 14px;
  color: var(--text-soft);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: #4338ca;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-meta {
  display: flex;
  gap: 40px;
  margin-top: 56px;
  list-style: none;
  flex-wrap: wrap;
}

.hero-meta li {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.hero-meta span {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
}

/* ---------- Sections ---------- */
.section {
  padding: 90px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 48px;
  position: relative;
  padding-bottom: 14px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46px;
  height: 4px;
  border-radius: 4px;
  background: var(--accent);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}

.avatar-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 4rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

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

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 20px;
}

.about-tags li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.skill-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: all 0.25s;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(79, 70, 229, 0.3);
}

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

.skill-card p {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.skill-bar {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 6px;
  overflow: hidden;
}

.skill-bar span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), #a855f7);
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--bg);
  transition: all 0.25s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(79, 70, 229, 0.3);
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-icon {
  font-size: 1.6rem;
}

.project-lang {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

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

.project-card p {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.project-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ---------- Blog ---------- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.blog-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s;
}

.blog-item:hover {
  box-shadow: var(--shadow);
  border-color: rgba(79, 70, 229, 0.3);
}

.blog-date {
  color: var(--text-soft);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.blog-item h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.blog-item h3 a {
  color: var(--text);
  text-decoration: none;
}

.blog-item h3 a:hover {
  color: var(--accent);
}

.blog-item p {
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-info p {
  color: var(--text-soft);
  margin-bottom: 20px;
}

.contact-info ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-info a {
  color: var(--accent);
  text-decoration: none;
}

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

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.contact-form .btn {
  align-self: flex-start;
  border: none;
}

.form-tip {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* ---------- 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: 860px) {
  .nav-links {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 18px;
    transform: translateY(-110%);
    transition: transform 0.25s ease;
  }

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

  .nav-toggle {
    display: flex;
  }

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

  .avatar-placeholder {
    width: 160px;
    height: 160px;
    font-size: 3rem;
  }

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

  .blog-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero {
    padding: 80px 0 60px;
  }
}
