/* ============================================
   Home Page Specific Styles
   ============================================ */

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(92,111,242,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(235,184,32,0.04) 0%, transparent 60%);
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-12);
  align-items: center;
  padding-block: var(--space-16);
}

.hero__content {
  max-width: 640px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: #dbf7ed;
  color: var(--color-success);
  border: 1px solid #8cf0c5;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-6);
  animation: badgeFadeIn 0.6s var(--ease-out-expo) both;
  animation-delay: 0.2s;
}

@keyframes badgeFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] .hero__badge {
  background: rgba(21,48,41,0.5);
  border-color: #375a4d;
}
.hero__status-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse-green 2s ease-in-out infinite;
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 var(--color-success); opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); opacity: 0.8; }
}

.hero__title {
  font-size: var(--text-hero);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
}
.hero__name {
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-accent-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__typed-wrapper {
  display: inline-block;
  min-height: 1.1em;
  color: var(--color-primary-400);
}
.typed-cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--color-primary-400);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}
.hero__desc strong { color: var(--color-primary-500); font-weight: 600; }

.hero__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
}

.hero__stats {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}
.hero__stat {
  text-align: center;
}
.hero__stat-num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.hero__stat-unit {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary-400);
  margin-left: 1px;
}
.hero__stat-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
  white-space: nowrap;
}
.hero__stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-subtle);
}

/* Hero Logo */
.hero__logo {
  position: relative;
  width: 320px;
  height: 320px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__logo-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color-primary-500) 0deg,
    var(--color-accent-500) 120deg,
    var(--color-primary-300) 240deg,
    var(--color-primary-500) 360deg
  );
  animation: spin 8s linear infinite;
  opacity: 0.3;
  filter: blur(20px);
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero__logo-glow {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92,111,242,0.12) 0%, transparent 70%);
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}
.hero__logo-svg {
  position: relative;
  z-index: 1;
  animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

.hero__logo-badge {
  position: absolute;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: float 3s ease-in-out infinite;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero__logo-badge--mp  { top: 20px; right: -10px; animation-delay: 0s; color: #07C160; }
.hero__logo-badge--web { bottom: 50px; right: -25px; animation-delay: 1s; color: var(--color-primary-500); }
.hero__logo-badge--app { bottom: 20px; left: -10px; animation-delay: 2s; color: var(--color-accent-500); }
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(4px); }
}

/* ========== Tech Section ========== */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.tech-category {
  padding: var(--space-8);
  border-radius: var(--radius-2xl);
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.tech-category::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out-expo);
  pointer-events: none;
}

.tech-category:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px -15px rgba(92,111,242,0.12);
}

.tech-category:hover::before {
  opacity: 1;
}

/* Different gradient overlays for each tech category */
.tech-category:nth-child(1):hover::before {
  background: linear-gradient(180deg, rgba(219,247,237,0.5) 0%, transparent 60%);
}

.tech-category:nth-child(2):hover::before {
  background: linear-gradient(180deg, rgba(222,230,251,0.5) 0%, transparent 60%);
}

.tech-category:nth-child(3):hover::before {
  background: linear-gradient(180deg, rgba(254,247,220,0.5) 0%, transparent 60%);
}

.tech-category__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  position: relative;
}

.tech-category__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-out-expo);
}

.tech-category:hover .tech-category__icon {
  transform: scale(1.08);
}

.tech-category__title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tech-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-4); }
.tech-item { display: flex; flex-direction: column; gap: var(--space-2); }
.tech-item__info { display: flex; align-items: center; gap: var(--space-3); }
.tech-item__logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 800;
  flex-shrink: 0;
  color: white;
}
.tech-logo--java   { background: #c2410c; }
.tech-logo--spring { background: #059669; }
.tech-logo--mysql  { background: #2563eb; }
.tech-logo--redis  { background: #dc2626; }
.tech-logo--vue    { background: #10b981; }
.tech-logo--react  { background: #0284c7; }
.tech-logo--uniapp { background: #4f46e5; }
.tech-logo--ts     { background: #1e40af; }
.tech-logo--docker { background: #0891b2; }

.tech-item__name { font-size: var(--text-sm); font-weight: 500; flex: 1; }

.tech-item__bar {
  height: 4px;
  background: var(--color-neutral-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
[data-theme="dark"] .tech-item__bar { background: #3a3f54; }
.tech-item__bar-fill {
  height: 100%;
  width: var(--pct, 0%);
  background: var(--color-primary-400);
  border-radius: var(--radius-full);
  transform-origin: left;
  animation: bar-fill 1s var(--ease-out-expo) forwards;
  animation-play-state: paused;
}
.revealed .tech-item__bar-fill { animation-play-state: running; }
@keyframes bar-fill {
  from { width: 0; }
  to { width: var(--pct, 0%); }
}

/* ========== Featured Projects ========== */
.featured-projects {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.project-card { display: flex; flex-direction: column; }
.project-card__img-wrap { position: relative; overflow: hidden; }
.project-card__img {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}
.project-card__img--mp     { background: linear-gradient(135deg, #dee6fb, #eef6fb); color: var(--color-primary-400); }
.project-card__img--admin  { background: linear-gradient(135deg, #ddf5ed, #eef6fb); color: var(--color-success); }
.project-card__img--ai     { background: linear-gradient(135deg, #fef3cd, #fbf9f2); color: var(--color-accent-500); }
[data-theme="dark"] .project-card__img--mp    { background: linear-gradient(135deg, #2b346e, #252a33); }
[data-theme="dark"] .project-card__img--admin { background: linear-gradient(135deg, #1d392f, #252a33); }
[data-theme="dark"] .project-card__img--ai    { background: linear-gradient(135deg, #3a3014, #2a261a); }

.project-card--featured .project-card__img { height: 240px; }

.project-card__status {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}
.project-card__featured-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: var(--color-accent-500);
  color: #1b1d30;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
}

.project-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
}
.project-card__title { font-size: var(--text-xl); font-weight: 700; }
.project-card--featured .project-card__title { font-size: var(--text-2xl); }
.project-card__desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); max-height: 4.5em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; text-overflow: ellipsis; word-break: break-word; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.project-card__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--space-2); }

/* Highlights (featured card) */
.project-card__highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-primary-50);
  border-radius: var(--radius-lg);
}
[data-theme="dark"] .project-card__highlights { background: #2e3246; }
.highlight-item { text-align: center; }
.highlight-item__num {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary-500);
}
.highlight-item__label { font-size: var(--text-xs); color: var(--text-tertiary); }

.projects-section__cta { text-align: center; }

/* ========== Blog Section ========== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}
.blog-card { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.blog-card__meta { display: flex; align-items: center; justify-content: space-between; }
.blog-card__date { font-size: var(--text-xs); color: var(--text-tertiary); }
.blog-card__title { font-size: var(--text-base); font-weight: 600; line-height: var(--leading-snug); }
.blog-card__title a { color: var(--text-primary); transition: color var(--dur-fast) var(--ease-out-quart); }
.blog-card__title a:hover { color: var(--color-primary-500); }
.blog-card__desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); flex: 1; }
.blog-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.blog-card__read { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--text-tertiary); }
.blog-card__link { font-size: var(--text-sm); font-weight: 500; color: var(--color-primary-500); }
.blog-section__cta { text-align: center; }

/* ========== Services Section ========== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}
.service-card {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: all var(--dur-normal) var(--ease-out-quart);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.service-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-card__title { font-size: var(--text-lg); font-weight: 700; }
.service-card__desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); flex: 1; }
.service-card__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}
.service-card__price-label { font-size: var(--text-xs); color: var(--text-tertiary); }
.service-card__price-value { font-size: var(--text-lg); font-weight: 700; color: var(--color-primary-500); }

.services-cta { text-align: center; }
.services-cta__note { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-tertiary); }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero__logo { display: none; }
  .tech-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .featured-projects { grid-template-columns: 1fr 1fr; }
  .featured-projects > :last-child { grid-column: 1 / -1; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero__stats { gap: var(--space-4); }
  .featured-projects { grid-template-columns: 1fr; }
  .featured-projects > :last-child { grid-column: auto; }
  .blog-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .hero__title { font-size: clamp(2.2rem, 8vw, 3.5rem); }
  .hero__actions { flex-direction: column; align-items: flex-start; }
  .hero__actions .btn { width: 100%; justify-content: center; }
}
