/* Sweet BakeArt — premium interaction layer (August 2026)
   Purposefully restrained motion for cards, founders, achievements,
   gallery previews, reviews, and signature gallery pieces. */

:root {
  --premium-ease: cubic-bezier(.22, 1, .36, 1);
  --premium-maroon: #852d38;
  --premium-rose: #d4c1c7;
}

/* --------------------------------------------------------------------------
   Discover Our Treats — keep the approved vertical layout, add only
   controlled micro-interactions.
   -------------------------------------------------------------------------- */
body.page-index .features .feature-card {
  transition:
    transform .55s var(--premium-ease),
    box-shadow .55s var(--premium-ease),
    border-color .45s ease !important;
}

body.page-index .features .feature-card .media img {
  transform: scale(1.001) !important;
  transform-origin: center center;
  transition: transform 1.15s var(--premium-ease), filter .65s ease !important;
  will-change: transform;
}

body.page-index .features .feature-card .tag {
  transition:
    transform .48s var(--premium-ease),
    box-shadow .48s ease,
    background-color .48s ease !important;
  will-change: transform;
}

body.page-index .features .feature-card .btn i {
  transition: transform .38s var(--premium-ease) !important;
}

@media (hover: hover) and (pointer: fine) {
  body.page-index .features .feature-card:hover {
    transform: translateY(-6px) !important;
    border-color: rgba(133, 45, 56, .16) !important;
    box-shadow: 0 24px 58px rgba(72, 34, 48, .16) !important;
  }

  body.page-index .features .feature-card:hover .media img {
    transform: scale(1.04) !important;
    filter: saturate(1.035) contrast(1.015);
  }

  body.page-index .features .feature-card:hover .tag {
    transform: translateY(-5px) !important;
    box-shadow: 0 13px 28px rgba(72, 34, 48, .16) !important;
    background: rgba(255, 251, 252, .96) !important;
  }

  body.page-index .features .feature-card:hover .btn i,
  body.page-index .features .feature-card .btn:hover i {
    transform: translateX(5px) !important;
  }
}

/* --------------------------------------------------------------------------
   Meet the Founders — alternating one-time entrance.
   The image container moves horizontally; the text rises independently.
   Existing image hover treatment remains intact.
   -------------------------------------------------------------------------- */
.founder-block.premium-reveal-pending .founder-image,
.founder-block.premium-reveal-pending .founder-info {
  opacity: 0;
  will-change: transform, opacity;
}

.founder-block.premium-reveal-pending:not(.reverse) .founder-image {
  transform: translate3d(-46px, 0, 0);
}

.founder-block.premium-reveal-pending.reverse .founder-image {
  transform: translate3d(46px, 0, 0);
}

.founder-block.premium-reveal-pending .founder-info {
  transform: translate3d(0, 28px, 0);
}

.founder-block.premium-inview .founder-image {
  animation: premiumFounderImageIn .9s var(--premium-ease) both;
}

.founder-block.premium-inview .founder-info {
  animation: premiumFounderCopyIn .78s var(--premium-ease) .18s both;
}

@keyframes premiumFounderImageIn {
  from { opacity: 0; }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes premiumFounderCopyIn {
  from { opacity: 0; transform: translate3d(0, 28px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* --------------------------------------------------------------------------
   Achievements — path draws first, then nodes and award cards reveal in order.
   JS adds the lightweight overlay path/classes and triggers this once.
   -------------------------------------------------------------------------- */

/* The previous implementation pulsed the trophy rays forever. The requested
   achievement motion is a single entrance, so the perpetual loop is removed. */
.achievements .ach-ray-g {
  animation: none !important;
}

.achievements.premium-achievements-ready .ach-path-reveal {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.achievements.premium-achievements-ready .ach-connector {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.achievements.premium-achievements-ready .ach-trophy {
  opacity: 0;
}

.achievements.premium-achievements-ready .ach-bub,
.achievements.premium-achievements-ready .ach-card-g {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  will-change: opacity, transform;
}

.achievements.premium-achievements-ready .ach-bub {
  transform: translate3d(0, 12px, 0) scale(.72);
}

.achievements.premium-achievements-ready .ach-card-g {
  transform: translate3d(30px, 0, 0);
}

.achievements.premium-inview .ach-path-reveal {
  animation: premiumAchievementPath 1.65s var(--premium-ease) .16s forwards;
}

.achievements.premium-inview .ach-trophy {
  animation: premiumAchievementTrophy .75s var(--premium-ease) .08s both;
}

.achievements.premium-inview .ach-bub {
  animation: premiumAchievementNode .62s var(--premium-ease) both;
  animation-delay: calc(.48s + (var(--ach-i, 0) * .16s));
}

.achievements.premium-inview .ach-card-g {
  animation: premiumAchievementCard .68s var(--premium-ease) both;
  animation-delay: calc(.58s + (var(--ach-i, 0) * .16s));
}

.achievements.premium-inview .ach-connector {
  animation: premiumAchievementPath .38s ease-out forwards;
  animation-delay: calc(.58s + (var(--ach-i, 0) * .16s));
}

@keyframes premiumAchievementPath {
  0%   { stroke-dashoffset: 1; opacity: 0; }
  12%  { opacity: .72; }
  100% { stroke-dashoffset: 0; opacity: .72; }
}

@keyframes premiumAchievementTrophy {
  from { opacity: 0; filter: blur(4px); }
  to   { opacity: 1; filter: blur(0); }
}

@keyframes premiumAchievementNode {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.72); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes premiumAchievementCard {
  from { opacity: 0; transform: translate3d(30px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* --------------------------------------------------------------------------
   Home gallery preview — staggered entrance plus an intentional hover state.
   -------------------------------------------------------------------------- */
.gallery-preview.premium-gallery-ready .gallery-preview-grid a {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(.985);
  will-change: opacity, transform;
}

.gallery-preview.premium-inview .gallery-preview-grid a {
  animation: premiumGalleryTileIn .72s var(--premium-ease) both;
  animation-delay: calc(.08s + (var(--gallery-i, 0) * .14s));
}

@keyframes premiumGalleryTileIn {
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

body.page-index .gallery-preview-grid a::after {
  background: linear-gradient(180deg, rgba(20, 10, 18, .04), rgba(20, 10, 18, .78)) !important;
  opacity: .28 !important;
  transition: opacity .58s ease, background .58s ease !important;
}

body.page-index .gallery-preview-grid .hint {
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  padding: .58rem .9rem;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(20, 10, 18, .34);
  opacity: 0;
  transform: translate3d(-50%, -36%, 0) scale(.92);
  transition: opacity .48s ease, transform .58s var(--premium-ease), background .48s ease !important;
  white-space: nowrap;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

body.page-index .gallery-preview-grid a img {
  transition: transform .9s var(--premium-ease), filter .58s ease !important;
}

@media (hover: hover) and (pointer: fine) {
  body.page-index .gallery-preview-grid a:hover::after {
    opacity: .74 !important;
  }

  body.page-index .gallery-preview-grid a:hover img {
    transform: scale(1.055) !important;
    filter: saturate(1.02) brightness(.9);
  }

  body.page-index .gallery-preview-grid a:hover .hint {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1);
    background: rgba(20, 10, 18, .48);
  }
}

/* --------------------------------------------------------------------------
   Reviews — no automatic movement. The card nearest the viewport is gently
   elevated after arrow, dot, swipe, or keyboard navigation settles.
   -------------------------------------------------------------------------- */
.review-card.review-focus {
  transform: translateY(-7px) scale(1.018) !important;
  border-color: rgba(133, 45, 56, .13) !important;
  box-shadow: 0 22px 52px rgba(72, 34, 48, .16) !important;
}

.review-card.review-focus.review-pulse {
  animation: premiumReviewSettle .62s var(--premium-ease) both;
}

@keyframes premiumReviewSettle {
  0%   { transform: translateY(-1px) scale(.995); }
  58%  { transform: translateY(-9px) scale(1.024); }
  100% { transform: translateY(-7px) scale(1.018); }
}

/* --------------------------------------------------------------------------
   Gallery signature pieces — matched to the supplied video reference.
   The card remains stable; hovering only gives the artwork a smooth,
   restrained zoom. The gold label carries its own continuous light sweep.
   -------------------------------------------------------------------------- */
body.page-gallery .gallery-item.signature {
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  outline: none;
  touch-action: manipulation;
  background: #f4f1ec !important;
  border: 2px solid rgba(198, 158, 44, .92) !important;
  border-radius: 22px !important;
  box-shadow:
    0 14px 34px rgba(50, 38, 20, .10),
    0 0 0 1px rgba(255, 236, 154, .52) inset !important;
  transform: none !important;
  transition:
    border-color .42s ease,
    box-shadow .55s var(--premium-ease) !important;
}

/* Disable the previous pointer-follow glow and the old pseudo-element badge. */
body.page-gallery .gallery-item.signature::before,
body.page-gallery .gallery-item.signature::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

body.page-gallery .gallery-item.signature .signature-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 236, 144, .88);
  border-radius: 999px;
  background:
    linear-gradient(102deg,
      #cfaa35 0%,
      #ecd060 29%,
      #d5b13d 55%,
      #f1d96f 78%,
      #d0aa35 100%);
  color: #211d16;
  box-shadow:
    0 8px 22px rgba(113, 83, 13, .20),
    0 1px 0 rgba(255,255,255,.52) inset;
  font-family: 'Open Sans', sans-serif;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
}

/* Bright vertical band travelling across the pill, as in the reference. */
body.page-gallery .gallery-item.signature .signature-tag::before {
  content: "";
  position: absolute;
  top: -18%;
  bottom: -18%;
  left: -44%;
  width: 30%;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,249,207,.34) 16%,
    rgba(255,255,255,.92) 50%,
    rgba(255,249,207,.34) 84%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-8deg);
  filter: blur(.15px);
  animation: signatureTagShine 2.75s ease-in-out infinite;
  pointer-events: none;
}

@keyframes signatureTagShine {
  0%, 10% { left: -44%; opacity: 0; }
  18% { opacity: .95; }
  56% { left: 116%; opacity: .95; }
  64%, 100% { left: 116%; opacity: 0; }
}

body.page-gallery .gallery-item.signature img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover !important;
  transform: scale(1) !important;
  filter: none !important;
  will-change: transform;
  transition: transform .82s cubic-bezier(.22,.61,.36,1) !important;
}

/* Keep the important upper artwork visible before hover. */
body.page-gallery #chocolate-sculptures img {
  object-position: 50% 27% !important;
  transform-origin: 50% 30%;
}

body.page-gallery #signature-deer img {
  object-position: 50% 7% !important;
  transform-origin: 50% 18%;
}

@media (hover: hover) and (pointer: fine) {
  body.page-gallery .gallery-item.signature:hover,
  body.page-gallery .gallery-item.signature:focus-visible,
  body.page-gallery .gallery-item.signature.signature-active {
    transform: none !important;
    border-color: rgba(211, 172, 55, 1) !important;
    box-shadow:
      0 18px 42px rgba(50, 38, 20, .14),
      0 0 0 1px rgba(255, 241, 174, .72) inset !important;
  }

  body.page-gallery .gallery-item.signature:hover img,
  body.page-gallery .gallery-item.signature:focus-visible img,
  body.page-gallery .gallery-item.signature.signature-active img {
    transform: scale(1.07) !important;
  }
}

body.page-gallery .gallery-item.signature:focus-visible {
  box-shadow:
    0 0 0 4px rgba(226, 191, 82, .24),
    0 18px 42px rgba(50, 38, 20, .14) !important;
}

body.page-gallery #chocolate-sculptures {
  scroll-margin-top: 120px;
}

/* Give the portrait signature artwork more breathing room on phones instead
   of forcing it into the generic 4:3 gallery crop. */
@media (max-width: 600px) {
  body.page-gallery .gallery-item.signature {
    aspect-ratio: 4 / 5 !important;
    min-height: 0 !important;
    border-radius: 18px !important;
  }

  body.page-gallery .gallery-item.signature .signature-tag {
    top: 12px;
    left: 12px;
    min-height: 34px;
    padding: 0 14px;
    font-size: .68rem;
    letter-spacing: .10em;
  }

  body.page-gallery #chocolate-sculptures img {
    object-position: 50% 24% !important;
  }

  body.page-gallery #signature-deer img {
    object-position: 50% 3% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-gallery .gallery-item.signature .signature-tag::before {
    animation: none !important;
    display: none !important;
  }

  body.page-gallery .gallery-item.signature img {
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   Responsive and accessibility safeguards.
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .founder-block.premium-reveal-pending:not(.reverse) .founder-image,
  .founder-block.premium-reveal-pending.reverse .founder-image {
    transform: translate3d(0, 24px, 0);
  }

  body.page-index .gallery-preview-grid .hint {
    opacity: 1;
    top: auto !important;
    bottom: 12px !important;
    left: 12px !important;
    transform: none;
    padding: .45rem .68rem;
    background: rgba(20, 10, 18, .42);
  }

  body.page-index .gallery-preview-grid a::after {
    opacity: .46 !important;
  }

  .review-card.review-focus {
    transform: translateY(-4px) scale(1.008) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .founder-block.premium-reveal-pending .founder-image,
  .founder-block.premium-reveal-pending .founder-info,
  .achievements.premium-achievements-ready .ach-trophy,
  .achievements.premium-achievements-ready .ach-bub,
  .achievements.premium-achievements-ready .ach-card-g,
  .gallery-preview.premium-gallery-ready .gallery-preview-grid a {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .achievements.premium-achievements-ready .ach-path-reveal,
  .achievements.premium-achievements-ready .ach-connector {
    stroke-dashoffset: 0 !important;
    opacity: .72 !important;
    animation: none !important;
  }

  body.page-index .features .feature-card,
  body.page-index .features .feature-card *,
  body.page-index .gallery-preview-grid a,
  body.page-index .gallery-preview-grid a *,
  body.page-gallery .gallery-item.signature,
  body.page-gallery .gallery-item.signature img,
  .review-card {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
