:root {
  --bg: #070b14;
  --bg-soft: #0c1220;
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e8ecf4;
  --text-dim: #9aa4b8;
  --text-faint: #6b7590;
  --accent: #6c8cff;
  --accent2: #22d3ee;
  --accent3: #a78bfa;
  --grad: linear-gradient(120deg, #6c8cff, #22d3ee 55%, #a78bfa);
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

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

html { scroll-behavior: smooth; }

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

::selection { background: rgba(108, 140, 255, 0.35); }

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

/* ---------- background decor ---------- */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: float 18s ease-in-out infinite alternate;
}
.blob-1 { width: 520px; height: 520px; top: -140px; left: -120px; background: radial-gradient(circle, rgba(108,140,255,.35), transparent 65%); }
.blob-2 { width: 460px; height: 460px; top: 30%; right: -160px; background: radial-gradient(circle, rgba(34,211,238,.25), transparent 65%); animation-delay: -6s; }
.blob-3 { width: 520px; height: 520px; bottom: -180px; left: 30%; background: radial-gradient(circle, rgba(167,139,250,.22), transparent 65%); animation-delay: -12s; }

@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(50px, -40px) scale(1.08); }
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(7, 11, 20, 0.65);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 24px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(108, 140, 255, .8);
}
.brand-name { font-size: 15px; }

.nav-links { margin-left: auto; display: flex; gap: 26px; }
.nav-links a {
  font-size: 14px; color: var(--text-dim);
  position: relative; padding: 4px 0;
  transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; border-radius: 2px;
  background: var(--grad);
  transition: width .25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.lang-switch {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}
.lang-switch:hover {
  border-color: var(--accent);
  background: rgba(108, 140, 255, .12);
  transform: translateY(-1px);
}
.lang-switch svg { opacity: .8; }

/* ---------- hero ---------- */
.hero {
  max-width: 1100px; margin: 0 auto;
  min-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  padding: 60px 24px 30px;
  position: relative;
}

.hero-content {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 60px;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 15px; margin-bottom: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px; color: var(--text-dim);
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .5); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero h1 {
  font-size: clamp(40px, 6vw, 62px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 1px;
}
.hero-sub {
  display: block;
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: 2px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 6px;
}

.hero-tagline { margin-top: 20px; font-size: 17px; color: var(--text); font-weight: 500; }
.hero-desc { margin-top: 12px; max-width: 560px; color: var(--text-dim); font-size: 15px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  transition: all .25s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(108, 140, 255, .35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(108, 140, 255, .5); }
.btn-ghost { border-color: var(--border-strong); background: var(--card); color: var(--text); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); background: rgba(108, 140, 255, .1); }

.hero-stats { display: flex; gap: 42px; margin-top: 44px; }
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-size: 30px; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { font-size: 13px; color: var(--text-faint); margin-top: 2px; }

.hero-side {
  display: flex; flex-direction: column; align-items: center;
  gap: 26px; width: 330px; flex-shrink: 0;
}

.hero-avatar { position: relative; width: 178px; height: 178px; flex-shrink: 0; }
.avatar-ring {
  position: absolute; inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #6c8cff, #22d3ee, #a78bfa, #6c8cff);
  animation: spin 8s linear infinite;
  filter: blur(2px);
  opacity: .9;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  z-index: 1;
}
.avatar-letter {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: 800;
  background: var(--bg-soft);
  border-radius: 50%;
  color: var(--text-dim);
}

.skill-card { width: 100%; padding: 22px; }

.scroll-hint {
  align-self: center;
  color: var(--text-faint);
  animation: bob 2s ease-in-out infinite;
  padding: 6px;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

/* ---------- sections ---------- */
.section { max-width: 1100px; margin: 0 auto; padding: 90px 24px 10px; }

.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-index {
  font-size: 14px; font-weight: 700; letter-spacing: 2px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-head h2 { font-size: 28px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; }
.section-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

.section-note { color: var(--text-dim); font-size: 14px; margin-bottom: 30px; }
.note-link {
  color: var(--accent);
  font-weight: 600;
  margin-left: 8px;
  white-space: nowrap;
  transition: color .2s;
}
.note-link:hover { color: var(--accent2); }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(6px);
  transition: all .3s ease;
}
.card:hover { background: var(--card-hover); border-color: var(--border-strong); }

.card-title { font-size: 16px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 9px; }
.card-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 3px;
  background: var(--grad);
}

/* about */
.skill-group { margin-bottom: 16px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-cat { display: block; font-size: 12.5px; color: var(--text-faint); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  background: rgba(108, 140, 255, .08);
  color: var(--text-dim);
  transition: all .2s;
}
.chip:hover { border-color: var(--accent); color: var(--text); background: rgba(108, 140, 255, .18); }

.award-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.award-list li {
  position: relative; padding-left: 22px;
  font-size: 13.5px; color: var(--text-dim);
}
.award-list li::before {
  content: "✦"; position: absolute; left: 0; top: 0;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: 12px;
}

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

.project-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  overflow: hidden;
}
.project-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .3s;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.project-card:hover::before { opacity: 1; }

.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.project-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(108,140,255,.18), rgba(34,211,238,.14));
  border: 1px solid var(--border);
  color: var(--accent2);
}
.project-lang {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-faint);
}
.project-lang i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.project-name { font-size: 17px; font-weight: 700; margin-bottom: 8px; letter-spacing: .3px; }
.project-desc { font-size: 13.5px; color: var(--text-dim); flex: 1; margin-bottom: 18px; }

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.project-tag {
  font-size: 11px; padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--text-faint);
}

.project-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.p-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  padding: 7px 14px;
  border-radius: 9px;
  transition: all .2s;
}
.p-link-demo { background: var(--grad); color: #fff; }
.p-link-demo:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(108, 140, 255, .4); }
.p-link-code { border: 1px solid var(--border-strong); color: var(--text-dim); }
.p-link-code:hover { color: var(--text); border-color: var(--accent); background: rgba(108,140,255,.08); }

.star-badge {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: #fbbf24; font-weight: 600;
}
.star-badge.zero { display: none; }

/* ---------- footer ---------- */
.footer {
  margin-top: 100px;
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.project-card.reveal { transition: opacity .6s ease, transform .6s ease, box-shadow .3s ease, border-color .3s ease; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-content { flex-direction: column-reverse; text-align: center; gap: 40px; padding-top: 20px; }
  .hero-side { width: min(100%, 400px); }
  .hero-avatar { width: 150px; height: 150px; }
  .skill-card { text-align: left; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; gap: 30px; }
  .nav-links { display: none; }
  .scroll-hint { display: none; }
}
@media (max-width: 560px) {
  .section { padding-top: 64px; }
  .hero { padding-top: 36px; }
  .hero-stats { flex-wrap: wrap; }
  .project-grid { grid-template-columns: 1fr; }
}
