:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #1a1f3a;
  --accent-blue: #4a5bff;
  --accent-purple: #7b3ff2;
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: #8b92b2;
  --card-bg: rgba(26, 31, 58, 0.52);
  --card-border: rgba(255, 255, 255, 0.12);
  --shadow-glow: 0 8px 32px rgba(74, 91, 255, 0.15);
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(74, 91, 255, 0.2), transparent 30%),
    radial-gradient(circle at 80% 30%, rgba(123, 63, 242, 0.16), transparent 35%),
    linear-gradient(145deg, var(--bg-primary), var(--bg-secondary));
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
}

#global-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  opacity: 0.82;
  mix-blend-mode: screen;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

.glass {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 14, 39, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 20px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.cta,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.cta,
.btn-primary {
  background: linear-gradient(110deg, var(--accent-blue), var(--accent-purple));
  color: white;
  padding: 10px 20px;
}

.btn-secondary {
  padding: 10px 20px;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.cta:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-primary);
  font-size: 1.2rem;
}

.hero {
  position: relative;
  min-height: 85vh;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  pointer-events: none;
  opacity: 0.65;
  z-index: 1;
  transition: transform 220ms linear;
}

.hero-orb-a {
  width: min(32vw, 340px);
  height: min(32vw, 340px);
  left: 8%;
  top: 14%;
  background: radial-gradient(circle, rgba(74, 91, 255, 0.52), rgba(74, 91, 255, 0));
}

.hero-orb-b {
  width: min(28vw, 280px);
  height: min(28vw, 280px);
  right: 10%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(123, 63, 242, 0.52), rgba(123, 63, 242, 0));
}

#hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  text-align: center;
  margin: 0 auto;
  padding: 60px 0;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(2.8rem, 8vw, 6rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.hero-subtitle {
  margin: 0 0 18px;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 300;
}

.hero-desc {
  color: var(--text-secondary);
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section {
  padding: 88px 0;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin: 0 0 36px;
  color: var(--text-secondary);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.card {
  padding: 26px;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1), border-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(123, 63, 242, 0.35);
}

.card.tilt-active {
  transform-style: preserve-3d;
  will-change: transform;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.metric-value {
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  margin: 0;
  font-weight: 700;
}

.metric-label {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  font-size: 0.88rem;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(74, 91, 255, 0.14);
  border: 1px solid rgba(74, 91, 255, 0.38);
}

.tag.soft {
  background: rgba(123, 63, 242, 0.14);
  border-color: rgba(123, 63, 242, 0.38);
}

.progress-item {
  margin-bottom: 18px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(110deg, var(--accent-blue), var(--accent-purple));
  transition: width 1200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--accent-blue), var(--accent-purple));
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
  padding-left: 18px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 9px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 0 6px rgba(74, 91, 255, 0.2);
}

.timeline-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.project-cover {
  width: 100%;
  height: 170px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: linear-gradient(145deg, rgba(74, 91, 255, 0.3), rgba(123, 63, 242, 0.3));
}

.project-card {
  perspective: 900px;
}

.project-link {
  color: #c2c7ff;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  padding: 12px;
  font: inherit;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.field-error {
  display: block;
  min-height: 18px;
  font-size: 0.82rem;
  color: #ff8e9c;
}

.form-feedback {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.site-footer {
  padding: 34px 0 46px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-secondary);
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1), transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.btn.magnetic {
  position: relative;
  will-change: transform;
}

@media (max-width: 1023px) {
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 6;
  }
}

@media (max-width: 767px) {
  .header-inner {
    min-height: 64px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: fixed;
    inset: 64px 0 0 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(8px);
    transform: translateY(-110%);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
  }

  .nav.is-open {
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    gap: 14px;
  }

  .desktop-cta {
    display: none;
  }

  .section {
    padding: 68px 0;
  }

  .hero {
    min-height: 78vh;
  }

  .hero-title {
    font-size: clamp(2.5rem, 14vw, 3rem);
  }

  #hero-particles {
    display: none;
  }

  .hero-orb {
    display: none;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }

  .split-grid {
    grid-template-columns: 1fr;
  }
}
