/* =============================================
   Homepage — Meirong.dev lively redesign
   ============================================= */

.homepage {
  padding: 0.5rem 0 3rem;
}

/* ── Hero Section ── */
.hero {
  padding: 2.5rem 0 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.12));
}

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

.hero-greeting {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.hero-wave {
  font-size: 2rem;
  display: inline-block;
  animation: wave 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0;
  color: var(--foreground);
  border: none;
}

.hero-name {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted, rgba(241, 245, 249, 0.55));
  margin: 0.75rem 0 1.25rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--foreground);
  background: var(--surface, rgba(30, 41, 59, 0.7));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.12));
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hero-link:hover {
  background: var(--surface-hover, rgba(51, 65, 85, 0.6));
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.hero-link svg {
  flex-shrink: 0;
}

/* ── Section shared styles ── */
.home-section {
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.12));
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
}

.section-icon {
  font-size: 1.2rem;
}

.section-more {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.section-more:hover {
  opacity: 0.8;
  text-decoration: none;
  color: var(--accent);
}

/* ── Post Cards ── */
.post-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-card {
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.post-card-link {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--surface, rgba(30, 41, 59, 0.7));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.12));
  border-radius: 10px;
  text-decoration: none;
  color: var(--foreground);
  transition: all 0.2s ease;
}

.post-card-link:hover {
  background: var(--surface-hover, rgba(51, 65, 85, 0.6));
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: var(--foreground);
}

.post-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--foreground);
  line-height: 1.4;
  transition: color 0.2s;
}

.post-card-link:hover .post-card-title {
  color: var(--accent);
}

.post-card-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted, rgba(241, 245, 249, 0.55));
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.post-card-date {
  font-size: 0.75rem;
  color: var(--text-muted, rgba(241, 245, 249, 0.55));
  font-weight: 500;
}

.post-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.post-card-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  border-radius: 4px;
  font-weight: 600;
}

/* ── Tag Cloud ── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--foreground);
  background: var(--surface, rgba(30, 41, 59, 0.7));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.12));
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag-pill:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}

.tag-count {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  color: var(--text-muted, rgba(241, 245, 249, 0.55));
}

.tag-pill:hover .tag-count {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent);
}

/* ── Services Grid ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  background: var(--surface, rgba(30, 41, 59, 0.7));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.12));
  border-radius: 10px;
  text-decoration: none;
  color: var(--foreground);
  text-align: center;
  transition: all 0.2s ease;
}

.service-card:hover {
  background: var(--surface-hover, rgba(51, 65, 85, 0.6));
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: var(--foreground);
}

.service-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.2s;
}

.service-card:hover .service-icon {
  transform: scale(1.1);
}

.service-name {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.service-desc {
  font-size: 0.65rem;
  color: var(--text-muted, rgba(241, 245, 249, 0.55));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero-title {
    font-size: 1.4rem;
  }

  .hero-tagline {
    font-size: 0.9rem;
  }

  .hero-links {
    gap: 0.4rem;
  }

  .hero-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .post-card-link {
    padding: 1rem;
  }

  .services-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
  }

  .service-card {
    padding: 0.75rem 0.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
}
