:root {
  --bg-deep: #05060a;
  --bg-card: rgba(12, 14, 22, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaef;
  --text-muted: rgba(232, 234, 239, 0.55);
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --emerald: #34d399;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-deep);
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.aurora {
  position: fixed;
  width: 140%;
  height: 60%;
  top: -20%;
  left: -20%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(34, 211, 238, 0.18), transparent 60%),
    radial-gradient(ellipse 45% 35% at 75% 20%, rgba(167, 139, 250, 0.15), transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 80%, rgba(52, 211, 153, 0.1), transparent 50%);
  filter: blur(40px);
  animation: aurora-shift 18s var(--ease) infinite alternate;
}

@keyframes aurora-shift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(4%, 2%) scale(1.05);
    opacity: 0.92;
  }
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 70%);
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.header-nav a:hover {
  color: var(--text);
}

main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.hero {
  margin-bottom: 3.5rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.gradient-text {
  background: linear-gradient(105deg, var(--cyan) 0%, var(--violet) 45%, var(--emerald) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 36rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.projects {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .projects {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.project-card {
  position: relative;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.02) 40%,
    rgba(255, 255, 255, 0.06)
  );
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.project-card[data-accent="cyan"] {
  --accent: var(--cyan);
  --accent-dim: rgba(34, 211, 238, 0.12);
}

.project-card[data-accent="violet"] {
  --accent: var(--violet);
  --accent-dim: rgba(167, 139, 250, 0.12);
}

.project-card[data-accent="emerald"] {
  --accent: var(--emerald);
  --accent-dim: rgba(52, 211, 153, 0.12);
}

.card-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-dim), transparent 70%);
  pointer-events: none;
}

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

.card-inner {
  position: relative;
  border-radius: calc(var(--radius) - 1px);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 1.5rem 1.5rem 1.35rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  opacity: 0.9;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.card-desc {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.card-meta {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-meta li {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--bg-deep);
  background: var(--accent);
  box-shadow: 0 10px 28px var(--accent-dim);
  border: none;
  transition: filter 0.25s ease, transform 0.25s var(--ease), box-shadow 0.25s ease;
}

.card-cta:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
  box-shadow: 0 14px 36px var(--accent-dim);
}

.card-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.stack-strip {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section-lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 40rem;
}

.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stack-chips span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.site-footer {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
}

.footer-contact {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  font-size: 0.85rem;
}

.footer-contact-label {
  color: var(--text-muted);
  font-weight: 500;
}

.footer-mail {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* 覆盖浏览器对 mailto 链接的默认蓝色（:link / :visited） */
.site-footer a.footer-mail,
.site-footer a.footer-mail:link,
.site-footer a.footer-mail:visited {
  color: #6b7280 !important;
}

.site-footer a.footer-mail:hover {
  color: #9ca3af !important;
}

.site-footer a.footer-mail:active {
  color: #8b92a0 !important;
}

@media (max-width: 640px) {
  .site-header {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
