/* —— Hero —— */
.hero-section__img {
  transform: scale(1.06);
  animation: heroKenBurns 18s ease-in-out infinite alternate;
}

.hero-section.is-ready .hero-section__img {
  animation-play-state: running;
}

@keyframes heroKenBurns {
  from {
    transform: scale(1.04);
  }
  to {
    transform: scale(1.1);
  }
}

[data-hero-reveal] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 0.12s + 0.15s);
}

.hero-section.is-ready [data-hero-reveal] {
  opacity: 1;
  transform: translateY(0);
}

.hero-yarn-float__ball {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size, 2.75rem);
  height: var(--size, 2.75rem);
  border-radius: 50%;
  background: var(--color);
  box-shadow:
    inset -4px -6px 12px rgba(0, 0, 0, 0.12),
    inset 3px 3px 8px rgba(255, 255, 255, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.15);
  animation: yarnFloat 5s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0.85;
}

@keyframes yarnFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(6deg);
  }
}

.hero-scroll-hint {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease 0.85s, transform 0.6s ease 0.85s;
}

.hero-section.is-ready .hero-scroll-hint {
  opacity: 1;
  transform: translateY(0);
}

.hero-scroll-hint__dot {
  animation: scrollHintBounce 1.8s ease-in-out infinite;
}

@keyframes scrollHintBounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

/* —— Scroll reveal —— */
[data-reveal] {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--reveal-i, 0) * 0.08s);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Product cards —— */
.product-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.product-card:hover {
  transform: translateY(-6px);
}

.product-card__img-wrap {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover .product-card__img-wrap {
  transform: scale(1.04);
}

/* —— Featured products carousel —— */
.fp-carousel__viewport {
  overflow: hidden;
}

.fp-carousel__track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px; /* prevent clipping of box-shadow */
}

.fp-carousel__track::-webkit-scrollbar {
  display: none;
}

.fp-carousel__slide {
  flex-shrink: 0;
  width: calc(50% - 0.625rem);   /* 2 per row mobile */
  scroll-snap-align: start;
}

@media (min-width: 640px) {
  .fp-carousel__slide {
    width: calc(33.333% - 0.834rem); /* 3 per row */
  }
}

@media (min-width: 1024px) {
  .fp-carousel__slide {
    width: calc(25% - 0.938rem);  /* 4 per row */
  }
}

.fp-carousel__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #d6d1c9;
  border-radius: 6px;
  background: #fff;
  color: #5a5248;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  outline: none;
}

.fp-carousel__arrow:hover {
  background: #f6f3ef;
  border-color: #a9a099;
  color: #2a2520;
}

.fp-carousel__arrow[aria-disabled="true"] {
  opacity: 0.3;
  pointer-events: none;
}

/* —— Stat counters —— */
[data-count] {
  font-variant-numeric: tabular-nums;
}

/* —— Pattern cards (home) —— */
.pattern-card-home {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.pattern-card-home:hover {
  transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
  .hero-section__img,
  .hero-yarn-float__ball,
  .hero-scroll-hint__dot,
  [data-hero-reveal],
  [data-reveal] {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .product-card:hover,
  .pattern-card-home:hover {
    transform: none;
  }

  .product-card:hover .product-card__img-wrap {
    transform: none;
  }
}
