/* Fixed ambient background layers (never attached to scrolling containers) */
.bg-grid-pattern {
  background-image:
    linear-gradient(to right, rgba(24, 24, 27, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(24, 24, 27, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}

html.dark .bg-grid-pattern {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

.bg-spotlight {
  background: radial-gradient(
    680px circle at 78% 12%,
    rgba(244, 63, 94, 0.07),
    transparent 65%
  );
}

html.dark .bg-spotlight {
  background: radial-gradient(
    680px circle at 78% 12%,
    rgba(244, 63, 94, 0.09),
    transparent 65%
  );
}

/* Shimmer primary CTA */
.shimmer-btn {
  overflow: hidden;
}

.shimmer-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.22),
    transparent
  );
  transition: transform 0.6s ease;
}

.shimmer-btn:hover::after {
  transform: translateX(100%);
}

/* Active tab styling */
.tab.active {
  background-color: #ffffff;
  color: #18181b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

html.dark .tab.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Staggered card entrance (transform + opacity only) */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-enter {
  animation: cardEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--index, 0) * 25ms);
}

/* Subreddit bar reveal (transform: scaleX only — zero layout thrash) */
@keyframes barScale {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.bar-fill {
  transform-origin: left center;
  animation: barScale 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Skeleton shimmer */
@keyframes skeletonPulse {
  0%, 100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.85;
  }
}

.skeleton-block {
  animation: skeletonPulse 1.4s ease-in-out infinite;
}

/* Activity Cadence Bar styling */
.cadence-bar-col {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.cadence-bar-col:hover {
  transform: translateY(-2px);
}

.keyword-pill {
  transition: all 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.keyword-pill:hover {
  transform: translateY(-1px);
}

.keyword-pill:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .card-enter,
  .bar-fill,
  .skeleton-block,
  .shimmer-btn::after,
  .cadence-bar-col:hover,
  .keyword-pill:hover {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
