/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-card: #f7f7f8;
  --bg-card-hover: #f0f0f2;
  --text: #1a1a2e;
  --text-dim: #666;
  --text-muted: #aaa;
  --border: rgba(0,0,0,0.06);
  --border-hover: rgba(0,0,0,0.14);
  --accent: #6c5ce7;
  --accent-soft: rgba(108,92,231,0.08);
  --glow-color: rgba(108, 92, 231, 0.16);
  --glow-size: 700px;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Cursor Glow ===== */
.cursor-glow {
  position: fixed;
  width: var(--glow-size);
  height: var(--glow-size);
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-color) 0%, rgba(108,92,231,0.06) 35%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
  will-change: left, top;
}
.cursor-glow.active { opacity: 1; }

.cursor-dot {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-bounce), height 0.3s var(--ease-bounce),
              background 0.3s, border-color 0.3s, opacity 0.3s, box-shadow 0.3s;
  opacity: 0;
  will-change: left, top;
  box-shadow: 0 0 12px rgba(108,92,231,0.4);
}
.cursor-dot.active { opacity: 1; }
.cursor-dot.hover {
  width: 48px;
  height: 48px;
  background: rgba(108,92,231,0.08);
  border: 1.5px solid rgba(108,92,231,0.25);
  box-shadow: 0 0 24px rgba(108,92,231,0.2);
}

/* Cursor trail dots */
.cursor-trail {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(108,92,231,0.3);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  will-change: left, top, opacity;
  transition: opacity 0.4s;
}

/* ===== Grid Lines ===== */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

/* ===== Layout ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 2;
}

/* ===== Navbar ===== */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1200px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 999px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.03);
  transition: all 0.4s var(--ease);
}
.nav.scrolled {
  background: rgba(255,255,255,0.75);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.nav-logo {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  transition: color 0.3s;
  text-transform: uppercase;
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  position: relative;
  perspective: 1200px;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.1s linear;
}

/* Bilingual Title Block — Dual Mask Reveal */
.hero-title {
  position: relative;
  margin-bottom: 48px;
  user-select: none;
  opacity: 0;
  animation: heroZoomIn 1.2s var(--ease) 0.3s forwards;
}

/* Chinese — bottom layer (default: fully visible, no mask) */
.hero-zh-layer {
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  font-size: clamp(4rem, 10vw, 8.5rem);
  letter-spacing: -3px;
  color: var(--text);
  position: relative;
  z-index: 1;
}

/* English — top layer (default: fully hidden) */
.hero-en-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(3.2rem, 8vw, 7rem);
  letter-spacing: -1px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--accent);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.hero-mask-canvas { display: none; }

.hero-en-sub {
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 16px;
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.7s forwards;
}

.hero-divider {
  width: 48px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto 32px;
  opacity: 0;
  animation: scaleIn 0.8s var(--ease) 0.9s forwards;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  font-weight: 300;
  max-width: 480px;
  letter-spacing: 0.3px;
  line-height: 1.8;
  opacity: 0;
  animation: fadeUp 1s var(--ease) 1s forwards;
}

/* Mouse-reactive spotlight on hero */
.hero-spotlight {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,92,231,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s;
  will-change: left, top;
}
.hero-spotlight.active { opacity: 1; }

/* Floating particles */
.hero-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: particleFloat 8s ease-in-out infinite;
}
.hero-particle:nth-child(1) {
  width: 4px; height: 4px;
  background: var(--accent);
  top: 20%; left: 15%;
  animation-delay: 0s;
  animation-duration: 7s;
}
.hero-particle:nth-child(2) {
  width: 3px; height: 3px;
  background: #a29bfe;
  top: 30%; right: 20%;
  animation-delay: -2s;
  animation-duration: 9s;
}
.hero-particle:nth-child(3) {
  width: 5px; height: 5px;
  background: #fd79a8;
  bottom: 25%; left: 25%;
  animation-delay: -4s;
  animation-duration: 6s;
}
.hero-particle:nth-child(4) {
  width: 3px; height: 3px;
  background: var(--accent);
  bottom: 35%; right: 15%;
  animation-delay: -1s;
  animation-duration: 10s;
}
.hero-particle:nth-child(5) {
  width: 4px; height: 4px;
  background: #a29bfe;
  top: 60%; left: 10%;
  animation-delay: -3s;
  animation-duration: 8s;
}
.hero-particle:nth-child(6) {
  width: 3px; height: 3px;
  background: #fd79a8;
  top: 15%; right: 30%;
  animation-delay: -5s;
  animation-duration: 11s;
}

@keyframes particleFloat {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
  20% { opacity: 0.6; }
  50% { opacity: 0.4; transform: translateY(-30px) scale(1); }
  80% { opacity: 0.6; }
}

@keyframes heroZoomIn {
  from { opacity: 0; transform: scale(0.85); filter: blur(8px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scaleX(0); }
  to { opacity: 1; transform: scaleX(1); }
}

.hero-scroll {
  position: absolute;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeUp 1s var(--ease) 1.3s forwards;
}
.hero-scroll span {
  font-size: 0.68rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ===== Divider ===== */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

/* ===== Section ===== */
.section {
  padding: 120px 0;
}

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--text-muted);
  margin-bottom: 56px;
  position: relative;
  display: inline-block;
}
.section-label::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===== Blog List ===== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 32px;
  padding: 36px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.5s var(--ease);
  position: relative;
  margin-bottom: 4px;
}
.blog-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.5s var(--ease);
  z-index: 0;
}
.blog-item:hover::before {
  background: var(--bg-card-hover);
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(108,92,231,0.06);
  transform: scale(1.01);
}
.blog-item:hover { transform: translateX(6px); }

.blog-item-content { position: relative; z-index: 1; }

.blog-item-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 500;
}

.blog-item-title {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  transition: all 0.3s;
}
.blog-item:hover .blog-item-title {
  color: var(--accent);
  transform: translateX(4px);
}

.blog-item-desc {
  font-size: 0.86rem;
  color: var(--text-dim);
  font-weight: 300;
  max-width: 500px;
  transition: color 0.3s;
}
.blog-item:hover .blog-item-desc { color: var(--text); }

.blog-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  transition: color 0.3s;
}
.blog-item:hover .blog-item-meta { color: var(--text-dim); }

.blog-item-arrow {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  color: var(--accent);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  transition: all 0.4s var(--ease-bounce);
  opacity: 0;
  transform: translateX(-12px) scale(0.8);
}
.blog-item:hover .blog-item-arrow {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
}

.about-visual {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #f8f8fa, #f0f0f4);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.5s var(--ease);
}
.about-visual:hover {
  transform: scale(1.02) rotate(-1deg);
  box-shadow: 0 20px 60px rgba(108,92,231,0.08);
}
.about-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(108,92,231,0.06), transparent 60%);
}
.about-visual-icon {
  font-size: 5rem;
  position: relative;
  z-index: 1;
  transition: transform 0.5s var(--ease-bounce);
}
.about-visual:hover .about-visual-icon {
  transform: scale(1.1) rotate(5deg);
}

.about-text h3 {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -0.5px;
  margin-bottom: 28px;
}
.about-text h3 strong {
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-text p {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 300;
  margin-bottom: 16px;
  line-height: 1.85;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}
.tag {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  transition: all 0.4s var(--ease-bounce);
}
.tag:hover {
  color: var(--accent);
  border-color: rgba(108,92,231,0.3);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* ===== Stats ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 80px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  transition: all 0.5s var(--ease);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a29bfe, #fd79a8);
  transform: scaleX(0);
  transition: transform 0.5s var(--ease);
}
.stat:hover::after { transform: scaleX(1); }
.stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(108,92,231,0.08);
  border-color: rgba(108,92,231,0.12);
}
.stat-num {
  font-size: 2.2rem;
  font-weight: 200;
  letter-spacing: -1px;
  margin-bottom: 8px;
  color: var(--text);
  transition: color 0.3s;
}
.stat:hover .stat-num {
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
  padding: 48px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.footer a {
  color: var(--text-dim);
  transition: color 0.3s;
}
.footer a:hover { color: var(--accent); }

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 0.8; transform: scaleY(1.1); }
}

/* Staggered reveal for list items */
.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Blog items get extra stagger */
.blog-item.reveal {
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease),
              padding 0.5s var(--ease);
}

/* Section label slide-in */
.section-label.reveal {
  transform: translateX(-20px);
}
.section-label.reveal.visible {
  transform: translateX(0);
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  body { cursor: auto; }
  .cursor-glow, .cursor-dot, .cursor-trail { display: none; }
  .nav {
    width: calc(100% - 32px);
    padding: 0 20px;
    top: 12px;
  }
  .nav-links { gap: 16px; }
  .container { padding: 0 20px; }
  .section { padding: 80px 0; }
  .blog-item { grid-template-columns: 1fr; gap: 8px; padding: 28px 16px; }
  .blog-item-meta { order: -1; }
  .blog-item-arrow { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-visual { max-width: 280px; margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { letter-spacing: -1px; }
}
