/* Smart Snack motion system: lightweight CSS/JS, no WebGL. */

:root {
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --motion-soft: cubic-bezier(.2, .7, .2, 1);
}

/* Hero entrance */
.has-motion .hero-copy > *,
.has-motion .hero-visual {
  opacity: 0;
}

.has-motion .hero-copy > * {
  transform: translate3d(0, 26px, 0);
  transition:
    opacity .75s var(--motion-ease),
    transform .9s var(--motion-ease);
}

.has-motion .hero-copy > :nth-child(1) { transition-delay: 80ms; }
.has-motion .hero-copy > :nth-child(2) { transition-delay: 150ms; }
.has-motion .hero-copy > :nth-child(3) { transition-delay: 240ms; }
.has-motion .hero-copy > :nth-child(4) { transition-delay: 330ms; }

.has-motion .hero-visual {
  transform: translate3d(32px, 12px, 0) scale(.96);
  transition:
    opacity 1s var(--motion-ease) 180ms,
    transform 1.15s var(--motion-ease) 180ms;
}

.has-motion .hero.is-hero-ready .hero-copy > *,
.has-motion .hero.is-hero-ready .hero-visual {
  opacity: 1;
  transform: none;
}

.hero-visual img {
  --parallax-y: 0px;
  transform: translate3d(-3%, var(--parallax-y), 0);
  transition: filter .45s ease;
  will-change: transform;
}

.hero-sun {
  --parallax-y: 0px;
  transform: translate3d(0, var(--parallax-y), 0);
  will-change: transform;
}

/* Scroll reveal */
.has-motion .motion-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(.985);
  transition:
    opacity .65s var(--motion-ease),
    transform .8s var(--motion-ease);
  transition-delay: var(--motion-delay, 0ms);
}

.has-motion .motion-reveal.motion-in {
  opacity: 1;
  transform: none;
}

/* Product scale and card hover */
.category-card {
  transition:
    transform .48s var(--motion-ease),
    box-shadow .48s ease,
    border-color .3s ease;
}

.category-card.motion-in:hover,
.category-card.motion-in:focus-within {
  transform: translate3d(0, -7px, 0);
  box-shadow: 0 24px 58px rgba(76, 48, 33, .14);
}

.category-card .product-image img {
  transform-origin: 50% 80%;
  transition:
    transform .72s var(--motion-ease),
    filter .5s ease;
}

.category-card:hover .product-image img,
.category-card:focus-within .product-image img {
  transform: scale(1.075) rotate(-.8deg);
  filter: saturate(1.06);
}

.sku-card {
  transition:
    transform .35s var(--motion-ease),
    box-shadow .35s ease,
    border-color .3s ease;
}

.sku-card:hover {
  transform: translate3d(0, -4px, 0);
  box-shadow: 0 16px 34px rgba(76, 48, 33, .1);
}

.sku-card .sku-image img {
  transition: transform .55s var(--motion-ease);
}

.sku-card:hover .sku-image img {
  transform: scale(1.035);
}

.benefit-story.is-complete .benefit-card {
  transition:
    transform .4s var(--motion-ease),
    box-shadow .4s ease;
}

.benefit-story.is-complete .benefit-card:hover {
  transform: translate3d(0, -6px, 0);
  box-shadow: 0 20px 42px rgba(76, 48, 33, .11);
}

.benefit-card .benefit-icon {
  transition:
    transform .45s var(--motion-ease),
    background .35s ease,
    color .35s ease;
}

.benefit-card:hover .benefit-icon {
  transform: rotate(-7deg) scale(1.1);
  background: var(--green);
  color: #fff;
}

.trust-certificate,
.trust-review,
.contact-card {
  transition:
    transform .42s var(--motion-ease),
    box-shadow .42s ease;
}

.trust-certificate:hover,
.trust-review:hover {
  transform: translate3d(0, -5px, 0);
  box-shadow: 0 20px 44px rgba(66, 60, 82, .09);
}

.button {
  transition:
    transform .28s var(--motion-ease),
    box-shadow .28s ease,
    background .25s ease,
    color .25s ease;
}

.button:hover {
  transform: translate3d(0, -2px, 0);
}

.button:active {
  transform: translate3d(0, 0, 0) scale(.985);
}

/* Gentle parallax */
.statement-product img,
.production-photo img {
  --parallax-y: 0px;
  transform: translate3d(0, var(--parallax-y), 0);
  will-change: transform;
}

.production-card {
  --parallax-y: 0px;
  background-position: right calc(50% + var(--parallax-y));
}

/* Crumb micro-motion */
.crumb {
  animation: crumb-pulse 3.8s ease-in-out infinite alternate;
  will-change: transform;
}

.crumb-two {
  animation-delay: -1.4s;
  animation-duration: 4.6s;
}

.food-crumb {
  animation: food-crumb-float 5.8s ease-in-out infinite alternate;
  animation-delay: -1s;
  will-change: transform;
}

.food-crumb:nth-child(2n) { animation-delay: -2.4s; animation-duration: 6.8s; }
.food-crumb:nth-child(3n) { animation-delay: -4.1s; animation-duration: 7.5s; }

.food-symbol {
  animation: food-symbol-breathe 7s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.food-symbol:nth-of-type(2n) {
  animation-delay: -3s;
  animation-duration: 8.5s;
}

@keyframes crumb-pulse {
  from { transform: translate3d(0, 0, 0) rotate(24deg) scale(.92); }
  to { transform: translate3d(5px, -8px, 0) rotate(48deg) scale(1.08); }
}

@keyframes food-crumb-float {
  from { transform: translate(-50%, -50%) rotate(var(--turn)) translate3d(0, 0, 0); }
  to { transform: translate(-50%, -50%) rotate(calc(var(--turn) + 18deg)) translate3d(5px, -7px, 0); }
}

@keyframes food-symbol-breathe {
  from { transform: translate(-50%, -50%) rotate(var(--turn)) scale(.96); opacity: .48; }
  to { transform: translate(-50%, -50%) rotate(calc(var(--turn) + 4deg)) scale(1.04); opacity: .72; }
}

@media (max-width: 960px) {
  .has-motion .motion-reveal {
    transform: translate3d(0, 16px, 0);
    transition-duration: .5s, .6s;
  }

  .has-motion .hero-visual {
    transform: translate3d(0, 16px, 0) scale(.98);
  }

  .category-card.motion-in:hover,
  .category-card.motion-in:focus-within,
  .trust-certificate:hover,
  .trust-review:hover {
    transform: none;
  }

  .food-symbol {
    animation-duration: 10s;
  }
}

@media (max-width: 680px) {
  .hero {
    gap: 0;
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .hero-eyebrow {
    margin-bottom: 11px;
    font-size: .62rem;
    letter-spacing: .105em;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 9.2vw, 2.35rem);
    line-height: .92;
    letter-spacing: -.035em;
  }

  .hero-lead {
    margin: 15px 0 18px;
    font-size: .86rem;
    line-height: 1.48;
  }

  .hero .button-row {
    gap: 9px;
  }

  .hero .button {
    min-height: 46px;
    padding-inline: 20px;
    font-size: .84rem;
  }

  .hero .button-outline {
    padding-inline: 20px;
  }

  .hero-visual {
    min-height: 278px;
    margin-top: 10px;
    overflow: hidden;
  }

  .hero-visual img,
  .hero-sun,
  .statement-product img,
  .production-photo img {
    --parallax-y: 0px !important;
    will-change: auto;
  }

  .hero-visual img {
    width: 112%;
    max-height: 300px;
    transform: translate3d(-2%, -8px, 0);
  }

  .hero-sun {
    width: 68%;
    top: 0;
    right: 6%;
    transform: translate3d(0, 0, 0);
  }

  .food-crumb:nth-child(3n),
  .food-symbol:nth-of-type(2n) {
    animation: none;
  }

  .category-card:hover .product-image img,
  .category-card:focus-within .product-image img {
    transform: scale(1.025);
  }

  .product-grid {
    gap: 20px;
  }

  .category-card {
    min-height: 0;
    display: block;
  }

  .category-card > .product-copy {
    padding: 26px 22px 0;
    min-width: 0;
  }

  .category-card > .product-copy h3 {
    font-size: clamp(1.6rem, 8vw, 1.9rem);
    overflow-wrap: anywhere;
  }

  .category-card > .product-image {
    min-height: 245px;
  }

  .category-card > .product-copy,
  .category-card > .product-image,
  .category-card[aria-expanded="true"] > .product-copy,
  .category-card[aria-expanded="true"] > .product-image {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .category-card > .product-panel {
    position: static;
    inset: auto;
    width: auto;
    max-height: var(--mobile-panel-height, 0px);
    margin: 0;
    padding: 0 10px;
    overflow: hidden;
    overscroll-behavior: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    border-top: 1px solid transparent;
    transition:
      max-height .68s var(--motion-ease),
      opacity .32s ease,
      padding .55s var(--motion-ease),
      border-color .35s ease,
      visibility 0s linear .68s;
  }

  .category-card[aria-expanded="true"] > .product-panel {
    max-height: var(--mobile-panel-height, 2400px);
    padding: 14px 10px 18px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    border-top-color: rgba(76, 48, 33, .12);
    transition-delay: 0s;
  }

  .category-card > .product-panel .sku-grid {
    gap: 12px;
  }

  .category-card > .product-panel .sku-card {
    opacity: 1;
    transform: none;
  }

  .category-card .catalog-button {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .has-motion .hero-copy > *,
  .has-motion .hero-visual,
  .has-motion .motion-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .crumb,
  .food-crumb,
  .food-symbol,
  .statement-track {
    animation: none !important;
  }

  .hero-visual img,
  .hero-sun,
  .statement-product img,
  .production-photo img {
    --parallax-y: 0px !important;
    will-change: auto;
  }
}
