/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(12px) scale(.98); filter: saturate(.96); transition: transform .6s cubic-bezier(.22,1,.36,1), opacity .6s ease, filter .6s ease; will-change: transform, opacity, filter; }
.reveal.is-visible { opacity: 1; transform: none; filter: none; }
/*
  styles.css
  - Minimal, content-first styling
  - Blend of 2x.nz's clean layout and astro.build's bold gradients
*/

:root {
  --bg: #0b0d10;
  --bg-elev: #11151a;
  --panel: #141922;
  --text: #e6e8eb;
  --muted: #a4a9af;
  --primary: #8ab4ff;
  --accent: #a78bfa;
  --ring: #3b82f6;
  --border: #20252d;
  --card: #0f1319;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* 自动黑夜模式 - 基于系统偏好 */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --bg-elev: #ffffff;
    --panel: #ffffff;
    --text: #0b1020;
    --muted: #526072;
    --primary: #3b82f6;
    --accent: #7c3aed;
    --ring: #2563eb;
    --border: #e5e7eb;
    --card: #ffffff;
    --shadow: 0 10px 30px rgba(2, 6, 23, .08);
  }
}

/* 移除主题切换相关样式 */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Helvetica, Arial;
  background:
    /* soft vertical blend to avoid banding */
    linear-gradient(
      to bottom,
      color-mix(in oklab, var(--bg) 100%, transparent) 0%,
      color-mix(in oklab, var(--bg) 98%, transparent) 35%,
      color-mix(in oklab, var(--bg) 96%, transparent) 70%,
      color-mix(in oklab, var(--bg) 98%, transparent) 100%
    ),
    /* top glow */
    radial-gradient(1100px 520px at 15% -10%, rgba(99,102,241,.08), transparent 50%),
    /* bottom glow */
    radial-gradient(900px 460px at 50% 120%, rgba(34,211,238,.06), transparent 55%),
    var(--bg);
  color: var(--text);
  transform: translateZ(0);
  will-change: background-position;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessibility */
.skip-link { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }
.skip-link:focus { position: fixed; left: 12px; top: 12px; width: auto; height: auto; padding: 8px 12px; background: var(--panel); color: var(--text); border:1px solid var(--border); border-radius: 8px; z-index:9999; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 导航栏样式已移除 */

/* Hero */
.section-hero { position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero-inner { text-align: center; }
.hero-badge { display:inline-block; padding:6px 10px; font-size:12px; border:1px solid var(--border); color:var(--muted); border-radius:999px; background: color-mix(in oklab, var(--panel) 85%, transparent); }
.hero-title { font-size: clamp(32px, 6vw, 64px); line-height: 1.05; margin: 14px 0; font-weight: 800; letter-spacing: -0.02em; }
.gradient { 
  background: linear-gradient(92deg, #60a5fa, #a78bfa 40%, #22d3ee 80%, #60a5fa); 
  background-size: 300% 100%;
  -webkit-background-clip: text; 
  background-clip: text; 
  color: transparent;
  animation: gradient-flow 5s ease-in-out infinite;
}

@keyframes gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.hero-subtitle { color: var(--muted); font-size: 16px; margin: 12px auto 18px; max-width: 720px; }
.hero-ctas { display:flex; gap: 12px; justify-content:center; }
.btn { display:inline-block; padding: 12px 16px; border-radius: 12px; text-decoration:none; font-weight:600; border:1px solid var(--border); transition: transform .2s ease, box-shadow .2s ease, background-position .35s ease; will-change: transform, box-shadow, background-position; }
.btn-primary { background: linear-gradient(135deg, #6366f1, #22d3ee); color: white; border-color: transparent; box-shadow: var(--shadow); background-size: 200% 200%; }
.btn-ghost { background: color-mix(in oklab, var(--panel) 85%, transparent); color: var(--text); }
.btn:hover { transform: translateY(-1px); }
.btn-primary:hover { background-position: 80% 20%; }
.hero-glow { position: absolute; inset: -20% -10% auto -10%; height: 320px; filter: blur(48px); background: radial-gradient(700px 250px at 50% 42%, rgba(99,102,241,.12), transparent 70%); pointer-events:none; z-index: -1; }

/* Links section */
.section-links { padding: 26px 0; }
.links-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 980px) { .links-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .links-grid { grid-template-columns: 1fr; } }

/* 卡片图标样式 */
.card-icon {
  font-size: 20px;
  margin-bottom: 8px;
  opacity: 0.8;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  backdrop-filter: blur(10px);
}

.link-card:hover .card-icon,
.project-card:hover .card-icon,
.about-card:hover .card-icon {
  opacity: 1;
  transform: scale(1.1) rotate(5deg);
  background: rgba(99, 102, 241, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 增强的卡片基础样式 */
.link-card, .project-card, .about-card { 
  position: relative; 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  padding: 20px; 
  border: 1px solid var(--border); 
  border-radius: 16px; 
  background: linear-gradient(135deg, 
    color-mix(in oklab, var(--card) 95%, rgba(255,255,255,0.02)), 
    color-mix(in oklab, var(--card) 98%, rgba(255,255,255,0.01))
  );
  text-decoration: none; 
  color: var(--text); 
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 2px 4px -1px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(0) scale(1); 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  will-change: transform, box-shadow, border-color; 
  backdrop-filter: blur(10px);
  overflow: visible;
}

/* 卡片悬停效果 - 与Hero按钮保持一致 */
.link-card:hover, .project-card:hover, .about-card:hover { 
  transform: translateY(-4px) scale(1.02); 
  box-shadow: 
    0 20px 50px -12px rgba(99, 102, 241, 0.25),
    0 12px 30px -8px rgba(99, 102, 241, 0.15),
    0 8px 20px -4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: var(--primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 渐变边框效果 */
.link-card::before, .project-card::before, .about-card::before { 
  content: ""; 
  position: absolute; 
  inset: 0; 
  border-radius: inherit; 
  padding: 1px; 
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.4), 
    rgba(167, 139, 250, 0.4), 
    rgba(34, 211, 238, 0.4)
  ); 
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); 
  -webkit-mask-composite: xor; 
  mask-composite: exclude; 
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-card:hover::before, .project-card:hover::before, .about-card:hover::before { 
  opacity: 1; 
}

/* 卡片内容装饰 */
.link-card::after, .project-card::after, .about-card::after { 
  content: ""; 
  position: absolute; 
  top: 0; 
  right: 0; 
  width: 60px; 
  height: 60px; 
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.15), 
    rgba(167, 139, 250, 0.15)
  ); 
  border-radius: 0 16px 0 60px; 
  opacity: 0.6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-card:hover::after, .project-card:hover::after, .about-card:hover::after { 
  opacity: 0.9; 
  transform: scale(1.1);
}

.link-title { 
  font-weight: 700; 
  font-size: 16px;
  position: relative;
  z-index: 1;
}

.link-desc { 
  color: var(--muted); 
  font-size: 14px; 
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* Project section */
.section-project { padding: 26px 0; }
.project-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 860px) { .project-grid { grid-template-columns: 1fr; } }

.project-card { 
  position: relative; 
  background: linear-gradient(135deg, 
    color-mix(in oklab, var(--card) 95%, rgba(255,255,255,0.02)), 
    color-mix(in oklab, var(--card) 98%, rgba(255,255,255,0.01))
  ); 
  border: 1px solid var(--border); 
  border-radius: 16px; 
  padding: 20px; 
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 2px 4px -1px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(0) scale(1); 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  will-change: transform, box-shadow, border-color; 
  backdrop-filter: blur(10px);
  overflow: visible;
}

.project-card:hover { 
  transform: translateY(-4px) scale(1.02); 
  box-shadow: 
    0 20px 50px -12px rgba(99, 102, 241, 0.25),
    0 12px 30px -8px rgba(99, 102, 241, 0.15),
    0 8px 20px -4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: var(--primary);
}

.project-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 12px; 
}

.project-title { 
  margin: 8px 0; 
  font-size: 18px; 
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.project-desc { 
  color: var(--muted); 
  margin: 0 0 16px; 
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.project-actions { 
  display: flex; 
  gap: 12px; 
  position: relative;
  z-index: 1;
}

.badge { 
  display: inline-block; 
  padding: 6px 12px; 
  font-size: 12px; 
  border-radius: 999px; 
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.15), 
    rgba(167, 139, 250, 0.15)
  ); 
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary);
  font-weight: 500;
  backdrop-filter: blur(10px);
}

/* About */
.section-about { padding: 28px 0 60px; }
.section-about h2 { margin: 0 0 8px; font-size: 24px; }
.section-about p { color: var(--muted); max-width: 780px; }
.about-cards { margin-top: 20px; display:grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px) { .about-cards { grid-template-columns: 1fr; } }

.about-card { 
  position: relative; 
  background: linear-gradient(135deg, 
    color-mix(in oklab, var(--card) 95%, rgba(255,255,255,0.02)), 
    color-mix(in oklab, var(--card) 98%, rgba(255,255,255,0.01))
  ); 
  border: 1px solid var(--border); 
  border-radius: 16px; 
  padding: 20px; 
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 2px 4px -1px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(0) scale(1); 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  will-change: transform, box-shadow, border-color; 
  backdrop-filter: blur(10px);
  overflow: visible;
}

.about-card:hover { 
  transform: translateY(-4px) scale(1.02); 
  box-shadow: 
    0 20px 50px -12px rgba(99, 102, 241, 0.25),
    0 12px 30px -8px rgba(99, 102, 241, 0.15),
    0 8px 20px -4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: var(--primary);
}

.about-card h3 { 
  margin: 8px 0 12px; 
  font-size: 18px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.about-card ul { 
  margin: 0; 
  padding-left: 20px; 
  position: relative;
  z-index: 1;
}

.about-card li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.about-card a { 
  color: var(--primary); 
  text-decoration: none; 
  transition: color 0.2s ease;
}

.about-card a:hover { 
  color: var(--accent);
  text-decoration: underline; 
}

/* About section reveal defaults (auto) */
.section-about h2,
.section-about p {
  opacity: 0;
  transform: translateY(12px) scale(.98);
  filter: saturate(.96);
  transition: transform .6s cubic-bezier(.22,1,.36,1), opacity .6s ease, filter .6s ease;
  will-change: transform, opacity, filter;
}
.section-about h2.is-visible,
.section-about p.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* About reveal staggering */
.section-about h2.is-visible { transition-delay: .05s; }
.section-about p.is-visible { transition-delay: .12s; }
.section-about .about-cards .about-card:nth-child(1).is-visible { transition-delay: .18s; }
.section-about .about-cards .about-card:nth-child(2).is-visible { transition-delay: .26s; }
.section-about .about-cards .about-card:nth-child(3).is-visible { transition-delay: .34s; }
.section-about .about-cards .about-card:nth-child(4).is-visible { transition-delay: .42s; }

/* Footer */
.site-footer { border-top:1px solid var(--border); background: color-mix(in oklab, var(--bg) 92%, transparent); }
.footer-inner { height: 68px; display:flex; align-items:center; justify-content:space-between; color: var(--muted); }
.footer-links { display:flex; gap: 12px; }
.footer-links a { color: var(--muted); text-decoration:none; }
.footer-links a:hover { color: var(--text); }

/* Utilities */
.visually-hidden { position:absolute; clip:rect(0 0 0 0); clip-path: inset(50%); height:1px; width:1px; overflow:hidden; white-space:nowrap; }

/* 响应式导航样式已移除 */

/* 卡片悬停时的微妙发光效果 - 改为静态发光 */
.link-card:hover, .project-card:hover, .about-card:hover {
  box-shadow: 
    0 20px 50px -12px rgba(99, 102, 241, 0.25),
    0 12px 30px -8px rgba(99, 102, 241, 0.15),
    0 8px 20px -4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 卡片内容悬停效果 */
.link-card:hover .link-title,
.project-card:hover .project-title,
.about-card:hover h3 {
  color: var(--primary);
  transform: translateX(2px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 卡片悬停时的链接颜色变化 */
.link-card:hover .link-desc,
.project-card:hover .project-desc {
  color: var(--text);
  transform: translateX(1px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 响应式优化 */
@media (max-width: 768px) {
  .links-grid, .project-grid, .about-cards {
    gap: 16px;
  }
  
  .link-card, .project-card, .about-card {
    padding: 16px;
  }
  
  .card-icon {
    font-size: 18px;
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .card-icon {
    font-size: 16px;
    width: 24px;
    height: 24px;
  }
}

/* 深色模式下的额外效果 */
@media (prefers-color-scheme: dark) {
  .link-card, .project-card, .about-card {
    background: linear-gradient(135deg, 
      color-mix(in oklab, var(--card) 90%, rgba(255,255,255,0.03)), 
      color-mix(in oklab, var(--card) 95%, rgba(255,255,255,0.01))
    );
  }
  
  .card-icon {
    filter: brightness(1.1);
  }
}

/* 卡片进入动画 */
@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.link-card, .project-card, .about-card {
  animation: card-enter 0.6s ease-out forwards;
}

/* 卡片在is-visible状态下的样式 */
.link-card.is-visible, .project-card.is-visible, .about-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 卡片进入动画延迟 */
.links-grid .link-card:nth-child(1) { animation-delay: 0.1s; }
.links-grid .link-card:nth-child(2) { animation-delay: 0.2s; }
.links-grid .link-card:nth-child(3) { animation-delay: 0.3s; }
.links-grid .link-card:nth-child(4) { animation-delay: 0.4s; }
.links-grid .link-card:nth-child(5) { animation-delay: 0.5s; }

.project-grid .project-card:nth-child(1) { animation-delay: 0.2s; }
.project-grid .project-card:nth-child(2) { animation-delay: 0.3s; }

.about-cards .about-card:nth-child(1) { animation-delay: 0.3s; }
.about-cards .about-card:nth-child(2) { animation-delay: 0.4s; }

/* 修复鼠标移开后的动画问题 */
.link-card.is-visible, .project-card.is-visible, .about-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: none;
}


