:root {
  --bg: #0b0f1a;
  --bg-alt: #111827;
  --card: #1a2234;
  --text: #e5e7eb;
  --text-dim: #9ca3af;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --radius: 14px;
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand::first-letter {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  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: 0.3s;
}

/* ===== Hero ===== */
.hero {
  padding: 100px 0 80px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(139, 92, 246, 0.12), transparent);
}

.hero-inner {
  text-align: center;
}

.hero-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
}

.hero-greeting {
  color: var(--text-dim);
  font-size: 1.1rem;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin: 8px 0 8px;
  background: linear-gradient(135deg, #fff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-role {
  color: var(--accent-2);
  font-weight: 600;
  font-size: 1.15rem;
}

.hero-desc {
  max-width: 560px;
  margin: 20px auto 32px;
  color: var(--text-dim);
  font-size: 1.02rem;
}

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

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

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

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

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

.btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

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

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

.section-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 44px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

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

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

.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.5);
}

.skill-card h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  color: var(--accent-2);
}

.skill-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-card li {
  color: var(--text-dim);
  font-size: 0.95rem;
  padding-left: 18px;
  position: relative;
}

.skill-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

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

.project-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.25s, box-shadow 0.25s;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

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

.project-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

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

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

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

.blog-item {
  display: flex;
  align-items: baseline;
  gap: 20px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 18px 22px;
  transition: border-color 0.2s, transform 0.2s;
}

.blog-item:hover {
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateX(6px);
}

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

.blog-title {
  font-size: 1rem;
  font-weight: 500;
}

/* ===== Contact ===== */
.contact-inner {
  text-align: center;
}

.contact-desc {
  color: var(--text-dim);
  margin-bottom: 28px;
}

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

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

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

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    flex-direction: column;
    background: var(--bg-alt);
    width: min(280px, 80vw);
    padding: 24px 28px;
    gap: 18px;
    border-bottom-left-radius: var(--radius);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

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

  .nav-toggle {
    display: flex;
  }

  .blog-item {
    flex-direction: column;
    gap: 6px;
  }
}
