/*
 * Home page — liquid-glass hover.
 * Scope: this file is linked from /index.html only.
 *   1. Product cards (02/Products): image flush to the card border, card floats up.
 *   2. Buttons inside <main>: translucent glass surface, specular sweep, lift.
 * Pure CSS. No layout, markup or JS dependencies beyond the class hooks below.
 */

/* ── 1. Product cards ─────────────────────────────────────────────── */

/* Image reaches the card edge: drop the card padding, move it to the text block. */
.home-products .card-hover {
  padding: 0;
  overflow: hidden;
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.55s ease;
}

.home-products .card-hover > .relative {
  border: 0;
  border-radius: 0;
}

.home-products .card-hover > div:last-child {
  margin-top: 0;
  padding: 1.5rem 1.5rem 1.75rem;
}

/* Frame the supplied photography instead of letterboxing it inside the frame. */
.home-products .card-hover img[src^="/images/catalog/"] {
  object-fit: cover !important;
  background: none;
  transform: scale(1);
  transition:
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.6s ease;
}

.home-products .card-hover img[src*="crushed-bentonite"] {
  object-position: right center !important;
}

/* Liquid-glass reflection that sweeps across the photo on hover.
   Glass is faked with a specular gradient only — no backdrop blur, so the
   product photography stays sharp. */
.home-products .card-hover > .relative::before {
  content: "";
  position: absolute;
  inset: -25%;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 36%,
    rgba(255, 255, 255, 0.42) 47%,
    rgba(255, 255, 255, 0.12) 52%,
    rgba(255, 255, 255, 0) 64%
  );
  transform: translateX(-135%) skewX(-9deg);
  transition: transform 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Glass ring on the card edge. */
.home-products .card-hover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0);
  transition: box-shadow 0.55s ease;
}

/* Glass sheet over the photo while hovered — gradient highlights only,
   no blur, so the image stays readable. */
.home-products .card-hover > .relative::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(120% 90% at 16% 0%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 42%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28);
  transition: opacity 0.5s ease;
}

.home-products .card-hover:hover > .relative::after,
.home-products .card-hover:focus-visible > .relative::after {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .home-products .card-hover:hover,
  .home-products .card-hover:focus-visible {
    transform: translateY(-8px);
    box-shadow:
      0 2px 4px rgba(36, 28, 14, 0.06),
      0 18px 40px -16px rgba(36, 28, 14, 0.18),
      0 34px 68px -34px rgba(36, 28, 14, 0.22);
    border-color: rgb(219 195 147);
  }

  .home-products .card-hover:hover > .relative::before,
  .home-products .card-hover:focus-visible > .relative::before {
    transform: translateX(135%) skewX(-9deg);
  }

  .home-products .card-hover:hover img[src^="/images/catalog/"],
  .home-products .card-hover:focus-visible img[src^="/images/catalog/"] {
    transform: scale(1.055);
  }
}

.home-products .card-hover:hover::after,
.home-products .card-hover:focus-visible::after {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* ── 2. Buttons ───────────────────────────────────────────────────── */

main .btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  will-change: transform;
}

/* Persistent glass sheen on the button surface. */
main .btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 150% at 14% 0%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 48%);
  transition: opacity 0.45s ease;
}

main .btn:hover::before,
main .btn:focus-visible::before {
  opacity: 1;
}

/* Specular sweep — the highlight that reads as moving glass. */
main .btn::after {
  content: "";
  position: absolute;
  inset: -60% -40%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 38%,
    rgba(255, 255, 255, 0.42) 49%,
    rgba(255, 255, 255, 0.14) 54%,
    rgba(255, 255, 255, 0) 66%
  );
  backdrop-filter: blur(6px) saturate(150%);
  -webkit-backdrop-filter: blur(6px) saturate(150%);
  transform: translateX(-130%) skewX(-12deg);
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

main .btn:hover::after,
main .btn:focus-visible::after {
  transform: translateX(130%) skewX(-12deg);
}

@media (prefers-reduced-motion: no-preference) {
  main .btn:hover,
  main .btn:focus-visible {
    transform: translateY(-3px);
  }
}

/* Dark glass */
main .btn-primary:hover,
main .btn-primary:focus-visible {
  background-color: rgba(36, 28, 14, 0.84) !important;
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  box-shadow:
    0 14px 28px -14px rgba(36, 28, 14, 0.6),
    0 3px 8px -3px rgba(36, 28, 14, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    inset 1px 0 0 rgba(255, 255, 255, 0.1);
}

/* Frosted clear glass */
main .btn-ghost:hover,
main .btn-ghost:focus-visible {
  border-color: rgba(255, 255, 255, 0.92) !important;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.78) 0%,
      rgba(251, 248, 243, 0.42) 45%,
      rgba(255, 255, 255, 0.62) 100%
    ) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow:
    0 12px 26px -14px rgba(36, 28, 14, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* Bronze glass */
main .btn-bronze:hover,
main .btn-bronze:focus-visible {
  background-color: rgba(197, 160, 95, 0.88) !important;
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  box-shadow:
    0 14px 28px -14px rgba(168, 130, 62, 0.55),
    0 3px 8px -3px rgba(168, 130, 62, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

/* Inverse ghost on dark panels */
main .btn-ghost-invert:hover,
main .btn-ghost-invert:focus-visible {
  border-color: rgba(255, 255, 255, 0.85) !important;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.24) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.2) 100%
  ) !important;
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  box-shadow:
    0 12px 26px -14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* Text links: a hair of lift, no glass */
@media (prefers-reduced-motion: no-preference) {
  main .btn-link:hover,
  main .btn-link:focus-visible {
    transform: translateY(-1px);
  }
}

/* ── 3. Section rhythm ────────────────────────────────────────────── */
/* The homepage stacked 128px top + 128px bottom on most blocks (=256px of
   air between two sections). Trim to 88px / 64px while keeping the editorial
   breathing room. Only direct <main> children are affected. */

main > section.py-24 {
  padding-block: 4rem;
}

main > section.py-20 {
  padding-block: 3.25rem;
}

@media (min-width: 768px) {
  main > section.py-24 {
    padding-block: 5.5rem;
  }

  main > section.py-20 {
    padding-block: 4rem;
  }
}
