:root {
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --text: #1f2330;
  --text-muted: #5b6274;
  --accent: #3b82f6;
  --accent-soft: #e8f0fe;
  --border: #e6e8ef;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(31, 35, 48, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

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

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

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

.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(31, 35, 48, 0.05);
}

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

.brand {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.main-nav {
  display: flex;
  gap: 32px;
}

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

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

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

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

.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 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background:
    radial-gradient(600px 400px at 20% 10%, var(--accent-soft), transparent 60%),
    radial-gradient(500px 380px at 85% 90%, #f0fdf9, transparent 60%),
    var(--bg);
  position: relative;
}

.hero-inner {
  text-align: center;
  padding: 120px 0 80px;
}

.avatar-ring {
  width: 128px;
  height: 128px;
  margin: 0 auto 28px;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
}

.avatar-ring svg {
  border-radius: 50%;
  background: #fff;
}

.hero-name {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero-name .accent {
  color: var(--accent);
}

.hero-role {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: var(--text-muted);
  margin-bottom: 10px;
}

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

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

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 8px);
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  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: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.4);
}

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

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

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

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

.section-head {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

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

.about-quote {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}

.about-facts {
  list-style: none;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 28px;
}

.about-facts li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}

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

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

.about-facts strong {
  font-weight: 600;
}

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

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

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

.skill-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
}

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

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

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

.skill-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  transition: width 1.1s ease 0.2s;
}

.skill-bar span.animated {
  width: var(--w);
}

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

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

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

.project-thumb {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120px 80px at 30% 20%, rgba(255, 255, 255, 0.35), transparent),
    var(--tone);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.project-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

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

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

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

.project-tags span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.project-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.project-link:hover {
  text-decoration: underline;
}

/* ===== Contact ===== */
.contact-inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

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

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

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.footer-quote {
  color: var(--text);
  font-weight: 600;
}

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

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .main-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .main-nav.open {
    max-height: 260px;
  }

  .main-nav a {
    padding: 16px 0;
    width: 100%;
    text-align: center;
  }

  .nav-toggle {
    display: flex;
  }

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

  .section {
    padding: 72px 0;
  }
}
