/* ProfileCard-inspired holo/tilt for service bento cards (React Bits) */

.service-bento__grid {
  perspective: 1000px;
}

.service-bento__card.js-pc-card {
  --pc-light-x: 50%;
  --pc-light-y: 50%;
  --pc-pointer-x: 50%;
  --pc-pointer-y: 50%;
  --pc-band-x: 50%;
  --pc-band-y: 50%;
  --pc-reach: 0;
  --pc-rotate-x: 0deg;
  --pc-rotate-y: 0deg;
  --pc-shift-x: 0px;
  --pc-shift-y: 0px;
  --pc-tilt: 0;
  --pc-active: 0;
  --pc-holo: 0.72;
  --pc-glare: 0.48;
  --pc-holo-gain: 0.85;
  --pc-holo-detail: 0.55;
  --pc-blend: multiply;
  --pc-holo-filter: invert(1) hue-rotate(180deg);
  --pc-sheen: rgba(255, 255, 255, 0);
  --pc-shade: rgba(24, 24, 27, 0.12);
  --pc-frame-edge: rgba(24, 24, 27, 0.08);
  --pc-frame-highlight: rgba(255, 255, 255, 0.9);
  --pc-parallax: 6px;
  touch-action: pan-y;
  transform-style: preserve-3d;
  transform: rotateX(var(--pc-rotate-x)) rotateY(var(--pc-rotate-y));
  transition: box-shadow 0.2s ease, background 0.2s ease;
  will-change: transform;
  overflow: hidden;
  isolation: isolate;
}

body:not(.theme-light) .service-bento__card.js-pc-card {
  --pc-blend: color-dodge;
  --pc-holo-filter: hue-rotate(0deg);
  --pc-sheen: rgba(255, 255, 255, 0.14);
  --pc-shade: rgba(0, 0, 0, 0.35);
  --pc-frame-edge: rgba(255, 255, 255, 0.1);
  --pc-frame-highlight: rgba(255, 255, 255, 0.08);
}

.service-bento__card.js-pc-card:hover,
.service-bento__card.js-pc-card:focus-visible {
  transform: rotateX(var(--pc-rotate-x)) rotateY(var(--pc-rotate-y));
  text-decoration: none;
}

.service-bento__card-fx {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.service-bento__card-sheen,
.service-bento__card-holo,
.service-bento__card-glare,
.service-bento__card-shade,
.service-bento__card-rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.service-bento__card-sheen {
  background: radial-gradient(
    farthest-corner circle at calc(var(--pc-light-x) - 8px) calc(var(--pc-light-y) - 8px),
    var(--pc-sheen) 0%,
    transparent 55%
  );
  opacity: calc(var(--pc-holo) * var(--pc-active));
}

.service-bento__card-holo {
  --pc-spectrum: repeating-linear-gradient(
    0deg,
    hsl(2, 100%, 73%) 5%,
    hsl(53, 100%, 69%) 10%,
    hsl(93, 100%, 69%) 15%,
    hsl(176, 100%, 76%) 20%,
    hsl(228, 100%, 74%) 25%,
    hsl(260, 100%, 76%) 30%,
    hsl(2, 100%, 73%) 35%
  );
  --pc-bars: repeating-linear-gradient(
    -45deg,
    #0e152e 0%,
    hsl(180, 10%, 60%) 3.8%,
    hsl(180, 29%, 66%) 4.5%,
    hsl(180, 10%, 60%) 5.2%,
    #0e152e 10%,
    #0e152e 12%
  );
  --pc-falloff: radial-gradient(
    farthest-corner circle at var(--pc-pointer-x) var(--pc-pointer-y),
    hsla(0, 0%, 0%, 0.1) 12%,
    hsla(0, 0%, 0%, 0.15) 20%,
    hsla(0, 0%, 0%, 0.25) 120%
  );
  background-image: var(--pc-spectrum), var(--pc-bars), var(--pc-falloff);
  background-position:
    0 var(--pc-band-y),
    var(--pc-band-x) var(--pc-band-y),
    center;
  background-size:
    500% 500%,
    300% 300%,
    200% 200%;
  background-blend-mode: color, hard-light;
  mix-blend-mode: var(--pc-blend);
  filter: brightness(calc(0.66 + 0.19 * var(--pc-active))) contrast(calc(1.33 + 0.17 * var(--pc-active)))
    saturate(calc(0.33 + 0.17 * var(--pc-active))) var(--pc-holo-filter);
  opacity: calc(var(--pc-holo) * var(--pc-holo-gain) * (0.45 + 0.55 * var(--pc-active)));
}

.service-bento__card-holo-glow,
.service-bento__card-holo-shift {
  position: absolute;
  inset: 0;
  opacity: calc(var(--pc-active) * var(--pc-holo-detail));
}

.service-bento__card-holo-glow {
  background-image:
    linear-gradient(
      45deg,
      hsl(176, 100%, 76%),
      hsl(228, 100%, 74%),
      hsl(260, 100%, 76%),
      hsl(2, 100%, 73%),
      hsl(53, 100%, 69%),
      hsl(93, 100%, 69%)
    ),
    radial-gradient(circle at var(--pc-pointer-x) var(--pc-pointer-y), hsl(0, 0%, 70%) 0%, hsla(0, 0%, 30%, 0.2) 90%);
  background-size: 250% 250%, 100% 100%;
  background-position: var(--pc-pointer-x) var(--pc-pointer-y), center;
  background-blend-mode: color-dodge;
  filter: brightness(calc(2 - var(--pc-reach))) contrast(calc(var(--pc-reach) + 2))
    saturate(calc(0.5 + var(--pc-reach)));
  mix-blend-mode: luminosity;
}

.service-bento__card-holo-shift {
  background-image: var(--pc-spectrum), var(--pc-bars), var(--pc-falloff);
  background-position:
    0 var(--pc-band-y),
    calc(var(--pc-band-x) * 0.4) calc(var(--pc-band-y) * 0.5),
    center;
  background-size: 200% 300%, 700% 700%, 100% 100%;
  background-blend-mode: color, hard-light;
  mix-blend-mode: difference;
  filter: brightness(0.8) contrast(1.5);
}

.service-bento__card-glare {
  background: radial-gradient(
    farthest-corner circle at var(--pc-light-x) var(--pc-light-y),
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0.28) 20%,
    rgba(255, 255, 255, 0) 58%
  );
  mix-blend-mode: overlay;
  opacity: calc(var(--pc-glare) * var(--pc-active));
}

.service-bento__card-shade {
  background: radial-gradient(
    farthest-corner circle at var(--pc-light-x) var(--pc-light-y),
    transparent 30%,
    var(--pc-shade) 100%
  );
  opacity: calc(var(--pc-glare) * var(--pc-tilt));
}

.service-bento__card-rim {
  box-shadow:
    inset 0 0 0 1px var(--pc-frame-edge),
    inset 0 1px 0 var(--pc-frame-highlight);
}

.service-bento__card.js-pc-card .service-bento__card-title,
.service-bento__card.js-pc-card .service-bento__card-art {
  position: relative;
  z-index: 2;
}

.service-bento__card.js-pc-card .service-bento__card-art {
  transform: translate3d(var(--pc-shift-x), var(--pc-shift-y), 0);
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .service-bento__card.js-pc-card {
    transform: none !important;
  }

  .service-bento__card-fx {
    display: none;
  }
}
