/* The hit area stays level while the glass surface turns toward the pointer. */
.glass-hit {
  position: relative;
  display: grid;
  min-width: 0;
}

.glass-card {
  --glow-x: 50%;
  --glow-y: 50%;
  position: relative;
  isolation: isolate;
  min-width: 0;
}

.services-section {
  background:
    radial-gradient(ellipse at 22% 85%, #c9e3f75e, transparent 36%),
    radial-gradient(ellipse at 78% 16%, #d0e1fdc9, transparent 45%),
    linear-gradient(120deg, #edf3f9 10%, #e6f2fb 52%, #ecf1fa 82%);
}

.service-list .glass-light {
  --surface-light: rgb(135 204 255 / 45%);
  --rim-light: rgb(86 157 239 / 95%);
  background: linear-gradient(118deg, #ffffffb8 4%, #ffffff78 66%, #eff7ff87);
  border: 1px solid #fff;
  box-shadow: inset 0 0 0 1px #94b6d321, 0 5px 16px #3259730c;
  backdrop-filter: blur(15px) saturate(125%);
  -webkit-backdrop-filter: blur(15px) saturate(125%);
}

.glass-light > div,
.glass-light > img {
  position: relative;
  z-index: 1;
}

.glass-solution-hit {
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 82% 30%, #296293 0%, transparent 51%),
    linear-gradient(116deg, #102643 10%, #244979 65%, #163864);
}

.solution-display.glass-dark {
  --surface-light: rgb(110 205 255 / 28%);
  --rim-light: rgb(152 231 255);
  border-radius: inherit;
  background: linear-gradient(120deg, #173d67a1, #0b25439e 60%, #253e6175);
  box-shadow: inset 0 0 0 1px #cde6ff52, 0 10px 24px #12355716;
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
}

.glass-dark .solution-scene {
  z-index: 1;
  background: transparent;
}

.glass-dark .scene-art img {
  max-width: 430px;
  mask-image: linear-gradient(to right, transparent, #000 19%, #000 81%, transparent),
              linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}

.glass-card::before,
.glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.glass-card::before {
  z-index: 0;
  background: radial-gradient(ellipse 205px 155px at var(--glow-x) var(--glow-y), var(--surface-light), transparent 100%);
}

@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .glass-card::after {
    z-index: 3;
    padding: 2px;
    background: radial-gradient(ellipse 170px 125px at var(--glow-x) var(--glow-y), var(--rim-light) 2%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  }
}

@media (any-hover: hover) and (any-pointer: fine) and (prefers-reduced-motion: no-preference) {
  .glass-card {
    transform: perspective(1250px) rotateX(0deg) rotateY(0deg);
    transition: transform 350ms cubic-bezier(.2,.7,.3,1), box-shadow 240ms ease;
  }

  .glass-card::before,
  .glass-card::after,
  .glass-dark .solution-beam {
    transition: opacity 240ms ease;
  }

  .glass-card.glass-active {
    transform: perspective(1250px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition-duration: 85ms, 240ms;
  }

  .glass-light.glass-active {
    box-shadow: inset 0 0 0 1px #93b8db4f, 0 12px 25px -10px #2d588c45;
  }

  .glass-active::before,
  .glass-active::after { opacity: 1; }

  .glass-active .solution-beam { opacity: .22; }
}
