/* v3 scan: hologram scan sweeps on big images + animated gradient card borders. */
@property --v3-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.v3-scan { position: relative; }
.v3-scan-fx {
  position: absolute; inset: 0; z-index: 4; overflow: hidden; border-radius: inherit;
  pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 1px rgba(80, 230, 255, .9);
}
.v3-scan-fx::before {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background:
    repeating-linear-gradient(0deg, rgba(80, 230, 255, .55) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(90deg, rgba(80, 230, 255, .55) 0 1px, transparent 1px 14px);
}
.v3-scan-fx::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 36%;
  transform: translate3d(0, -100%, 0); mix-blend-mode: screen;
  background: linear-gradient(180deg, transparent, rgba(80, 230, 255, .35) 55%, rgba(220, 255, 255, .95) 96%, transparent);
}
.v3-scan-fx.v3-scanning { animation: v3-scan-edge 1.1s ease-out both; }
.v3-scan-fx.v3-scanning::before { animation: v3-scan-grid 1.1s ease-in-out both; }
.v3-scan-fx.v3-scanning::after { animation: v3-scan-bar 1.1s cubic-bezier(.45, 0, .55, 1) both; }
@keyframes v3-scan-edge { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes v3-scan-grid { 0% { opacity: 0; } 40% { opacity: .25; } 100% { opacity: 0; } }
@keyframes v3-scan-bar { from { transform: translate3d(0, -100%, 0); } to { transform: translate3d(0, 280%, 0); } }

/* gradient borders: injected span, so v2 ::before/::after stay untouched */
.v3-border {
  position: absolute; inset: 0; z-index: 3; padding: 1.5px; border-radius: inherit;
  pointer-events: none; opacity: .55;
  background: conic-gradient(from var(--v3-angle), #3fe3ff, #ff9a4d, transparent 55%, #3fe3ff);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask-composite: exclude;
  transition: opacity .3s;
}
@keyframes v3-border-spin { to { --v3-angle: 360deg; } }
@media (hover: hover) and (pointer: fine) {
  .v3-has-border:hover > .v3-border { opacity: 1; animation: v3-border-spin 4s linear infinite; }
}
@media (hover: none), (pointer: coarse) {
  .v3-has-border.v3-live > .v3-border { opacity: 1; animation: v3-border-spin 5s linear infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .v3-scan-fx { display: none; }
  .v3-border, .v3-has-border:hover > .v3-border, .v3-has-border.v3-live > .v3-border { animation: none !important; }
}
html.fx-off .v3-scan-fx { display: none; }
html.fx-off .v3-border, html.fx-off .v3-has-border:hover > .v3-border, html.fx-off .v3-has-border.v3-live > .v3-border { animation: none !important; }
