@property --iv-glint-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.iv-edge-glint {
  --iv-glint-color: var(--iv-color-accent);
  --iv-glint-duration: 1.2s;
  transition: box-shadow var(--iv-motion-slow) var(--iv-ease-out);
  position: relative;
  overflow: visible;
}

.iv-edge-glint:before {
  content: "";
  background: conic-gradient(from var(--iv-glint-angle, 0deg),
    transparent 0 70%,
    var(--iv-glint-color) 85%,
    transparent 100%);
  border-radius: inherit;
  opacity: 0;
  -webkit-mask-composite: xor;
  pointer-events: none;
  padding: 1px;
  position: absolute;
  inset: -1px;
  -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  -webkit-mask-position: 0 0, 0 0;
  mask-position: 0 0, 0 0;
  -webkit-mask-size: auto, auto;
  mask-size: auto, auto;
  -webkit-mask-repeat: repeat, repeat;
  mask-repeat: repeat, repeat;
  -webkit-mask-clip: content-box, border-box;
  mask-clip: content-box, border-box;
  -webkit-mask-origin: content-box, border-box;
  mask-origin: content-box, border-box;
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  -webkit-mask-source-type: auto, auto;
  mask-mode: match-source, match-source;
}

.iv-edge-glint:hover:before, .iv-edge-glint:focus-within:before, .iv-edge-glint[data-iv-inview]:before {
  animation: iv-edge-glint var(--iv-glint-duration) var(--iv-ease-out);
}

@keyframes iv-edge-glint {
  from {
    --iv-glint-angle: 0deg;
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  to {
    --iv-glint-angle: 360deg;
    opacity: 0;
  }
}

.iv-edge-near {
  --iv-near-radius: 160px;
  --iv-near-color: var(--iv-color-accent);
  box-shadow: 0 0 calc(var(--iv-near, 0) * 32px) calc(var(--iv-near, 0) * 2px) var(--iv-glow-primary);
  position: relative;
  overflow: visible;
}

.iv-edge-near:after {
  content: "";
  background: radial-gradient(var(--iv-near-radius) circle at var(--iv-mx, 50%) var(--iv-my, 50%),
    var(--iv-near-color),
    transparent 70%);
  border-radius: inherit;
  opacity: var(--iv-near, 0);
  transition: opacity var(--iv-motion-slow) var(--iv-ease-out);
  -webkit-mask-composite: xor;
  pointer-events: none;
  padding: 3px;
  position: absolute;
  inset: -1px;
  -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  -webkit-mask-position: 0 0, 0 0;
  mask-position: 0 0, 0 0;
  -webkit-mask-size: auto, auto;
  mask-size: auto, auto;
  -webkit-mask-repeat: repeat, repeat;
  mask-repeat: repeat, repeat;
  -webkit-mask-clip: content-box, border-box;
  mask-clip: content-box, border-box;
  -webkit-mask-origin: content-box, border-box;
  mask-origin: content-box, border-box;
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  -webkit-mask-source-type: auto, auto;
  mask-mode: match-source, match-source;
}

.iv-scan {
  --iv-scan-color: var(--iv-color-accent);
  --iv-scan-duration: 6s;
  --iv-scan-opacity: .8;
  position: relative;
  overflow: clip;
}

.iv-scan:after {
  content: "";
  background-image: linear-gradient(90deg,
    var(--iv-scan-color) 0 2px,
    color-mix(in oklab, var(--iv-scan-color) 22%, transparent) 2px,
    transparent 96px);
  opacity: 0;
  animation: iv-scan-h var(--iv-scan-duration) linear infinite;
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.iv-scan--v:after {
  background-image: linear-gradient(180deg,
    var(--iv-scan-color) 0 2px,
    color-mix(in oklab, var(--iv-scan-color) 22%, transparent) 2px,
    transparent 96px);
  animation-name: iv-scan-v;
}

@keyframes iv-scan-h {
  from {
    opacity: 0;
    transform: translateX(-10%);
  }

  10% {
    opacity: var(--iv-scan-opacity, 1);
  }

  90% {
    opacity: var(--iv-scan-opacity, 1);
  }

  to {
    opacity: 0;
    transform: translateX(110%);
  }
}

:where([dir="rtl"]) .iv-scan:not(.iv-scan--v):after {
  animation-name: iv-scan-h-rtl;
}

@keyframes iv-scan-h-rtl {
  from {
    opacity: 0;
    transform: translateX(10%);
  }

  10% {
    opacity: var(--iv-scan-opacity, 1);
  }

  90% {
    opacity: var(--iv-scan-opacity, 1);
  }

  to {
    opacity: 0;
    transform: translateX(-110%);
  }
}

@keyframes iv-scan-v {
  from {
    opacity: 0;
    transform: translateY(-10%);
  }

  10% {
    opacity: var(--iv-scan-opacity, 1);
  }

  90% {
    opacity: var(--iv-scan-opacity, 1);
  }

  to {
    opacity: 0;
    transform: translateY(110%);
  }
}

.iv-spark {
  --iv-spark-size: .5rem;
  --iv-spark-color: var(--iv-color-accent);
  inline-size: var(--iv-spark-size);
  block-size: var(--iv-spark-size);
  background-color: var(--iv-spark-color);
  border-radius: var(--iv-radius-full);
  box-shadow: 0 0 12px 2px var(--iv-glow-primary);
  animation: iv-spark 2s var(--iv-ease-out) infinite;
  animation-delay: calc(var(--iv-i, 0) * .26s);
  pointer-events: none;
  display: inline-block;
}

@keyframes iv-spark {
  from, to {
    opacity: .2;
    transform: scale(.5);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.iv-pulse-glow {
  animation: iv-pulse-glow 2s var(--iv-ease-out) infinite;
}

@keyframes iv-pulse-glow {
  from, to {
    box-shadow: 0 0 8px var(--iv-glow-primary);
  }

  50% {
    box-shadow: 0 0 16px 3px var(--iv-glow-primary);
  }
}

.iv-rise {
  --iv-rise-distance: .45em;
  --iv-rise-duration: .9s;
  --iv-rise-step: .12s;
  animation: iv-rise var(--iv-rise-duration) var(--iv-ease-out) backwards;
  animation-delay: calc(var(--iv-i, 0) * var(--iv-rise-step));
}

@keyframes iv-rise {
  from {
    opacity: 0;
    transform: translateY(var(--iv-rise-distance));
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.iv-reveal {
  --iv-reveal-distance: 24px;
  --iv-reveal-duration: .7s;
  opacity: 0;
  transform: translateY(var(--iv-reveal-distance));
  transition: opacity var(--iv-reveal-duration) var(--iv-ease-out),
    transform var(--iv-reveal-duration) var(--iv-ease-out);
  transition-delay: var(--iv-reveal-delay, 0s);
}

.iv-reveal[data-iv-inview], :where(:root:not([data-iv-js])) .iv-reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .iv-edge-glint:hover:before, .iv-edge-glint:focus-within:before, .iv-edge-glint[data-iv-inview]:before {
    background: var(--iv-glint-color);
    opacity: 1;
    animation: none;
  }

  .iv-edge-near:after {
    transition: none;
  }

  .iv-scan:after {
    content: none;
  }

  .iv-spark {
    opacity: 1;
    animation: none;
  }

  .iv-pulse-glow {
    box-shadow: 0 0 12px var(--iv-glow-primary);
    animation: none;
  }

  .iv-rise {
    animation: none;
  }

  .iv-reveal {
    opacity: 1;
    transition: none;
    transform: none;
  }
}

.iv-edge-glint:hover, .iv-edge-glint:focus-within, .iv-edge-glint[data-iv-inview] {
  box-shadow: 0 0 28px var(--iv-glow-primary);
}
