/* =========================================================
   supergary · 个人技术网站 · 深色科技风 / 紫色调
   ========================================================= */

:root {
  --bg: #0a0a12;
  --bg-soft: #0e0e1a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(168, 85, 247, 0.18);
  --border-strong: rgba(168, 85, 247, 0.4);
  --primary: #a855f7;
  --primary-2: #8b5cf6;
  --accent: #d946ef;
  --text: #f2effa;
  --text-dim: #a6a0c0;
  --text-dark: #6d6785;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
  --radius: 16px;
  --nav-h: 68px;
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- 背景：网格 + 光晕 ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
}

.bg-glow::before,
.bg-glow::after {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.35;
}

.bg-glow::before {
  background: #7c3aed;
  top: -180px;
  left: 8%;
}

.bg-glow::after {
  background: #a21caf;
  bottom: -220px;
  right: 4%;
  opacity: 0.22;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
}

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(10, 10, 18, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.9);
}

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 999px;
  transition: color 0.25s, background 0.25s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-links a.active {
  color: var(--text);
  background: rgba(168, 85, 247, 0.14);
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav-cta {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.4);
  transition: transform 0.25s, box-shadow 0.25s;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 26px rgba(168, 85, 247, 0.55);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ---------- 通用布局 ---------- */
main {
  padding-top: var(--nav-h);
}

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 96px 24px;
}

.section-head {
  margin-bottom: 48px;
}

.section-eyebrow {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--primary);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-sub {
  color: var(--text-dim);
  margin-top: 10px;
  max-width: 640px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 24px 40px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 2s infinite;
}

/* hero 大头像：圆形遮罩 + 绿色描边 + 淡淡绿色阴影，位于标题上方居中 */
.hero-avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #34d399;
  box-shadow: 0 0 28px rgba(52, 211, 153, 0.4);
  margin-bottom: 24px;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero-title {
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.35));
}

.hero-type {
  margin-top: 22px;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
  min-height: 2em;
}

.hero-type .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--primary);
  vertical-align: -0.15em;
  margin-left: 3px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-desc {
  max-width: 620px;
  color: var(--text-dim);
  margin-top: 18px;
  font-size: 1.02rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, border-color 0.25s;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(168, 85, 247, 0.6);
}

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

.btn-ghost:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.hero-scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dark);
  font-size: 1.3rem;
  animation: float 2.2s ease-in-out infinite;
}

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

/* ---------- 精选项目卡片 ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1), border-color 0.35s, box-shadow 0.35s;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), rgba(168, 85, 247, 0.14), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 30px rgba(168, 85, 247, 0.12);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.project-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(217, 70, 239, 0.2));
  border: 1px solid var(--border);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
}

.project-status {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--primary);
  background: rgba(168, 85, 247, 0.08);
}

.project-status.online {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.project-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-desc {
  color: var(--text-dim);
  font-size: 0.93rem;
  min-height: 4.4em;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 22px;
}

.tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  padding: 4px 10px;
  border-radius: 999px;
}

.tag.hl {
  color: var(--primary);
  border-color: var(--border-strong);
}

.project-links {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  transition: all 0.25s;
}

.link-btn:hover {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.4);
}

.section-more {
  margin-top: 44px;
  text-align: center;
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  text-align: center;
  background:
    radial-gradient(600px circle at 50% 0%, rgba(139, 92, 246, 0.18), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 72px 32px;
  overflow: hidden;
}

.cta h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.cta p {
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 34px;
}

/* ---------- 项目页 ---------- */
.page-hero {
  text-align: center;
  padding: 96px 24px 40px;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1px;
}

.page-hero h1 span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-hero p {
  color: var(--text-dim);
  margin-top: 14px;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 80px;
}

.project-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
  overflow: hidden;
}

.project-row::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.35s;
}

.project-row:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.4);
}

.project-row:hover::after {
  opacity: 1;
}

.project-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.project-row .project-title {
  font-size: 1.35rem;
  margin: 14px 0 10px;
}

.project-row .project-desc {
  font-size: 0.97rem;
  min-height: 0;
}

.project-meta {
  display: flex;
  gap: 18px;
  color: var(--text-dark);
  font-size: 0.85rem;
  font-family: var(--mono);
}

.project-row .link-btn {
  background: transparent;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 40px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer .nav-logo {
  font-size: 1rem;
}

.footer-links {
  display: flex;
  gap: 22px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.25s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy {
  margin-top: 24px;
  color: var(--text-dark);
  font-size: 0.82rem;
  font-family: var(--mono);
}

.footer-copy a {
  color: var(--text-dark);
  text-decoration: none;
  transition: color 0.25s;
}

.footer-copy a:hover {
  color: var(--primary);
}

.footer-social {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 40px;
}

.social-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 社交图标：浅灰色半透明（不用品牌原色） */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: rgba(242, 239, 250, 0.4);
  transition: color 0.25s, border-color 0.25s, transform 0.25s;
}

.social-icon:hover {
  color: rgba(242, 239, 250, 0.78);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.social-name {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* 二维码浮窗：hover 展示 */
.qr-popup {
  position: absolute;
  bottom: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 148px;
  padding: 10px;
  background: #171722;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 20;
}

.qr-popup::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #171722;
}

.qr-popup img {
  display: block;
  width: 100%;
  border-radius: 8px;
}

.social-item:hover .qr-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.3, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.3, 1);
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(10, 10, 18, 0.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 16px 5vw;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    padding: 12px 16px;
  }

  .nav-cta {
    text-align: center;
  }

  .hero {
    min-height: auto;
    padding-top: 110px;
  }

  .section {
    padding: 70px 20px;
  }

  .footer-inner {
    justify-content: center;
  }
}
