/* ========================================
   Index/Homepage Styles
   ======================================== */

/* Hero Section */
.hero {
  padding: clamp(80px, 12vw, 140px) 0 clamp(60px, 8vw, 100px);
  background: var(--bg);
  overflow: hidden;
  min-height: auto;
  display: flex;
  align-items: center;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 64px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.hero-title {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat strong {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat span {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Card Deck Animation */
.card-deck {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 440px;
  margin: 0 auto;
  perspective: 1000px;
}

.card-deck-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: all 0.6s ease;
  transform-style: preserve-3d;
  animation: stackCycle 9s infinite cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
}

.card-deck-item:nth-child(1) {
  animation-delay: 0s;
}

.card-deck-item:nth-child(2) {
  animation-delay: 3s;
}

.card-deck-item:nth-child(3) {
  animation-delay: 6s;
}

@keyframes stackCycle {
  0%,
  30% {
    opacity: 1;
    transform: translateY(0) scale(1);
    z-index: 3;
  }

  35% {
    opacity: 0;
    transform: translateY(-40px) scale(0.95);
    z-index: 3;
  }

  40% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    z-index: 1;
  }

  45%,
  65% {
    opacity: 1;
    transform: translateY(10px) scale(0.92);
    z-index: 1;
  }

  70%,
  95% {
    opacity: 1;
    transform: translateY(5px) scale(0.96);
    z-index: 2;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    z-index: 3;
  }
}

.card-face {
  width: 100%;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  backface-visibility: hidden;
}

.card-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.card-face h3 {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 700;
}

.card-face p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 16px;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-alt);
  padding: 8px 16px;
  border-radius: 20px;
}

.card-rating span:first-child {
  color: var(--rating-color);
}

/* Sections */
.section-header {
  text-align: center;
  margin-bottom: 80px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-header p {
  font-size: 20px;
  color: var(--text-secondary);
}

/* Plugins Section */
.plugins {
  padding: 120px 0;
  background: var(--bg);
}

.plugins-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  width: 100%;
  min-width: 0;
}

.plugin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.plugin-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.plugin-card.featured {
  border: 2px solid var(--text);
  box-shadow: var(--shadow-lg);
}

.plugin-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--text);
  color: var(--bg);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plugin-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.plugin-icon svg {
  width: 100%;
  height: 100%;
}

.plugin-card h3 {
  font-size: 24px;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--text);
}

.plugin-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.6;
  flex: 1;
}

.plugin-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.rating {
  color: var(--rating-color);
  font-weight: 600;
}

.downloads {
  color: var(--text-secondary);
  font-weight: 500;
}

.plugin-price {
  margin-bottom: 24px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
}

.period {
  color: var(--text-secondary);
  font-size: 16px;
}

/* CTA Section */
.cta {
  padding: 120px 0;
  background: var(--surface-alt);
  text-align: center;
  border-top: 1px solid var(--border);
}

.cta-content {
  max-width: 800px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: clamp(32px, 5.5vw, 56px);
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text);
  line-height: 1.1;
}

.cta-content p {
  font-size: 22px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* Index Responsive */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .card-deck {
    width: 100%;
    max-width: min(300px, 85vw);
    height: 400px;
  }

  .plugins-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 60px 0 40px;
    min-height: auto;
  }

  .hero-title {
    font-size: clamp(28px, 7vw, 40px);
    margin-bottom: 20px;
  }

  .hero-description {
    font-size: clamp(16px, 2.5vw, 18px);
    margin-bottom: 32px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-stats {
    gap: 32px;
  }

  .stat strong {
    font-size: 28px;
  }

  .section-header {
    margin-bottom: 48px;
  }

  .section-header h2 {
    font-size: clamp(28px, 6vw, 36px);
    margin-bottom: 12px;
  }

  .section-header p {
    font-size: clamp(14px, 2vw, 16px);
  }

  .plugins,
  .cta {
    padding: 60px 0;
  }

  .plugins-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
    min-width: 0;
  }

  .plugin-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .cta-content h2 {
    font-size: clamp(28px, 6vw, 36px);
    margin-bottom: 20px;
  }

  .cta-content p {
    font-size: clamp(16px, 2.5vw, 18px);
    margin-bottom: 32px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 60px 0 40px;
  }

  .hero-title {
    font-size: clamp(24px, 8vw, 32px);
    line-height: 1.2;
  }

  .hero-description {
    font-size: 16px;
  }

  .hero-actions {
    gap: 12px;
  }

  .hero-actions .btn {
    font-size: 14px;
    padding: 12px 20px;
  }

  .hero-stats {
    gap: 24px;
    flex-direction: column;
    align-items: center;
  }

  .section-header {
    margin-bottom: 48px;
  }

  .section-header h2 {
    font-size: clamp(24px, 7vw, 32px);
  }

  .section-header p {
    font-size: 14px;
  }

  .plugins,
  .cta {
    padding: 60px 0;
  }

  .plugins-grid {
    margin: 0;
    padding: 0;
    width: 100%;
  }

  .plugin-card {
    min-width: 0;
    width: 100%;
    padding: 24px;
    max-width: 100%;
  }

  .cta-content h2 {
    font-size: clamp(24px, 7vw, 32px);
  }

  .cta-content p {
    font-size: 16px;
  }

  .card-deck {
    width: 100%;
    max-width: min(280px, 90vw);
    height: 360px;
  }

  .card-face {
    padding: 20px;
  }

  .card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
  }

  .card-face h3 {
    font-size: 20px;
  }

  .card-face p {
    font-size: 14px;
  }
}

