/* ===== CSS Variables ===== */
:root {
  --color-bg: #f0f4ff;
  --color-surface: rgba(255, 255, 255, 0.25);
  --color-surface-hover: rgba(255, 255, 255, 0.45);
  --color-surface-solid: #ffffff;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-light: #94a3b8;
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-light: #eef2ff;
  --color-border: rgba(148, 163, 184, 0.25);
  --color-nav-bg: rgba(240, 244, 255, 0.4);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 6px rgba(99, 102, 241, 0.06);
  --shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
  --shadow-md: 0 6px 24px rgba(99, 102, 241, 0.12);
  --shadow-lg: 0 16px 40px rgba(99, 102, 241, 0.14);
  --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.2);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--color-bg);
  background-image:
    radial-gradient(rgba(148, 163, 184, 0.18) 0.8px, transparent 0.8px),
    radial-gradient(rgba(99, 102, 241, 0.1) 1.2px, transparent 1.2px);
  background-size: 26px 26px, 52px 52px;
  background-position: 0 0, 13px 13px;
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: all var(--transition);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.25);
  border-bottom-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 30px rgba(99, 102, 241, 0.12);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-links a {
  display: inline-block;
  padding: 8px 16px;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 60px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f0f4ff 0%, #e8ecff 40%, #f5f0ff 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: -25%;
  right: -15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(139, 92, 246, 0.08) 40%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -15%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  max-width: 520px;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(270deg, #4f46e5, #7c3aed, #a855f7, #ec4899, #7c3aed, #4f46e5);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: liquidText 8s linear infinite;
  transform: translate3d(0, 0, 0);
}

@keyframes liquidText {
  from { background-position: 200% center; }
  to { background-position: 0% center; }
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-outline {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.8);
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-md);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(270deg, #4f46e5, #7c3aed, #a855f7, #ec4899, #7c3aed, #4f46e5);
  background-size: 200% 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.4), 0 0 0 20px rgba(99, 102, 241, 0.1), 0 0 0 50px rgba(99, 102, 241, 0.05);
  animation: liquidAvatar 10s linear infinite;
  transform: translate3d(0, 0, 0);
  position: relative;
}

@keyframes liquidAvatar {
  from { background-position: 200% 50%; }
  to { background-position: 0% 50%; }
}

.avatar-text {
  font-size: 5rem;
  font-weight: 700;
  color: #fff;
  user-select: none;
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-indicator span {
  display: block;
  width: 20px;
  height: 32px;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  position: relative;
}

.scroll-indicator span::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  background: var(--color-text-light);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll 2s ease-in-out infinite;
}

@keyframes scroll {
  0%, 100% { opacity: 1; top: 6px; }
  50% { opacity: 0.3; top: 14px; }
}

/* ===== Sections ===== */
.section {
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

/* Alternating section backgrounds with visible gradient shapes */
#about {
  background: linear-gradient(180deg, #f0f4ff 0%, #e8ecff 50%, #f0f4ff 100%);
}

#about::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#about::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

#blog {
  background: linear-gradient(180deg, #f0f4ff 0%, #f5f0ff 50%, #f0f4ff 100%);
}

#blog::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -15%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.18) 0%, rgba(99, 102, 241, 0.08) 45%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#projects {
  background: linear-gradient(180deg, #f0f4ff 0%, #e8eeff 50%, #f0f4ff 100%);
}

#projects::before {
  content: '';
  position: absolute;
  top: -25%;
  right: -15%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(168, 85, 247, 0.08) 45%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#contact {
  background: linear-gradient(180deg, #f0f4ff 0%, #f0eeff 50%, #f0f4ff 100%);
}

#contact::before {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 3px;
  margin-top: 8px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.view-all {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  padding: 4px 0;
}

.view-all:hover {
  text-decoration: underline;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: start;
}

.about-text p {
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7, #8b5cf6, #6366f1);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.8);
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* ===== Blog Cards ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.blog-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7, #8b5cf6, #6366f1);
}

.blog-card:hover {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.8);
}

.blog-card-placeholder {
  opacity: 0.6;
}

.blog-card-placeholder:hover {
  opacity: 0.8;
}

.blog-card-date {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

.blog-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.blog-card-title a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
}

.blog-card-title a:hover {
  color: var(--color-primary);
}

.blog-card-excerpt {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.blog-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-card-tags span {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 100px;
  font-weight: 500;
}

/* ===== Projects ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7, #8b5cf6, #6366f1);
}

.project-card:hover {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.8);
}

.project-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-card p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.project-tech {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-tech span {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.78rem;
  background: #f3f4f6;
  color: var(--color-text-secondary);
  border-radius: 100px;
}

/* ===== Contact ===== */
.contact-intro {
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.8);
  color: var(--color-primary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-3px);
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.footer p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.footer-icp {
  margin-top: 6px;
}

.footer-icp a {
  font-size: 0.85rem;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* ===== Blog Post Page ===== */
.blog-post {
  padding: 120px 0 60px;
  max-width: 720px;
  margin: 0 auto;
}

.blog-post-header {
  margin-bottom: 40px;
}

.blog-post-date {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.blog-post-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 16px;
}

.blog-post-tags {
  display: flex;
  gap: 8px;
}

.blog-post-tags span {
  padding: 4px 12px;
  font-size: 0.8rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 100px;
  font-weight: 500;
}

.blog-post-body {
  font-size: 1.05rem;
  line-height: 1.9;
}

.blog-post-body p {
  margin-bottom: 20px;
  color: var(--color-text-secondary);
}

.blog-post-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 40px 0 16px;
  letter-spacing: -0.01em;
}

.blog-post-body code {
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

.blog-post-body pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
}

.blog-post-nav {
  margin-top: 60px;
}

.blog-post-nav a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.blog-post-nav a:hover {
  text-decoration: underline;
}

/* ===== Blog List Page ===== */
.blog-list {
  padding: 120px 0 60px;
}

.blog-list-header {
  margin-bottom: 48px;
}

.blog-list-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.blog-list-header p {
  color: var(--color-text-secondary);
}

.blog-list .blog-card {
  margin-bottom: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-content {
    margin: 0 auto;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .hero-avatar {
    width: 140px;
    height: 140px;
  }

  .avatar-text {
    font-size: 3.5rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .section-title {
    font-size: 1.6rem;
  }

  .section {
    padding: 80px 0;
  }

  /* Mobile Nav */
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

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

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .blog-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .blog-post-header h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .about-stats {
    gap: 8px;
  }

  .stat-card {
    padding: 16px 8px;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .contact-links {
    flex-direction: column;
  }
}
