/* Opt-in FX: suppress legacy ::before/::after when data-tt-fx is set */
[data-tt-fx] {
  --tt-fx-a: 0.5;
  position: relative;
}
[data-tt-fx][data-tt-fx-i="soft"] { --tt-fx-a: 0.32; }
[data-tt-fx][data-tt-fx-i="mid"] { --tt-fx-a: 0.55; }
[data-tt-fx][data-tt-fx-i="strong"] { --tt-fx-a: 0.82; }

[data-tt-fx]::before,
[data-tt-fx]::after {
  content: none !important;
  animation: none !important;
  background-image: none !important;
  box-shadow: none !important;
}

[data-tt-fx="none"]::before,
[data-tt-fx="none"]::after {
  content: none !important;
}

/* Hover mode: effect layer only on hover */
[data-tt-fx][data-tt-fx-m="hover"] .tt-fx-layer {
  opacity: 0;
  transition: opacity .2s steps(2);
}
[data-tt-fx][data-tt-fx-m="hover"]:hover .tt-fx-layer,
[data-tt-fx][data-tt-fx-m="hover"]:focus-within .tt-fx-layer {
  opacity: 1;
}

.tt-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  html:not(.tt-fx-ignore-prm) [data-tt-fx] .tt-fx-layer,
  html:not(.tt-fx-ignore-prm) [data-tt-fx]::before,
  html:not(.tt-fx-ignore-prm) [data-tt-fx]::after {
    animation: none !important;
  }
}
[data-tt-fx="neon"] {
  overflow: visible;
  z-index: 1;
  box-shadow:
    0 0 0 1px rgba(255, 61, 138, calc(var(--tt-fx-a) * 0.9)),
    0 0 calc(10px + var(--tt-fx-a) * 22px) rgba(255, 61, 138, calc(var(--tt-fx-a) * 0.85)),
    0 0 calc(22px + var(--tt-fx-a) * 36px) rgba(255, 26, 60, calc(var(--tt-fx-a) * 0.55));
  animation: tt-fx-neon 2.4s steps(2) infinite;
}
[data-tt-fx="neon"][data-tt-fx-m="hover"] {
  box-shadow: none;
  animation: none;
  transition: box-shadow .2s steps(2);
}
[data-tt-fx="neon"][data-tt-fx-m="hover"]:hover {
  box-shadow:
    0 0 0 1px rgba(255, 61, 138, 0.85),
    0 0 18px rgba(255, 61, 138, 0.9),
    0 0 36px rgba(255, 26, 60, 0.55);
  animation: tt-fx-neon 2.4s steps(2) infinite;
}
/* Photo stays original — glow/outline only, no filter / blend / color wash on img */
[data-tt-fx="neon"] img {
  filter: none;
}
@keyframes tt-fx-neon {
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 61, 138, calc(var(--tt-fx-a))),
      0 0 calc(16px + var(--tt-fx-a) * 28px) rgba(255, 61, 138, calc(var(--tt-fx-a))),
      0 0 calc(30px + var(--tt-fx-a) * 40px) rgba(255, 26, 60, calc(var(--tt-fx-a) * 0.7));
  }
}
.card:has([data-tt-fx="neon"]),
.model-card:has([data-tt-fx="neon"]) {
  overflow: visible;
}
.models-rail:has([data-tt-fx="neon"]) {
  padding-top: 14px;
  padding-bottom: 18px;
}
@media (prefers-reduced-motion: reduce) {
  html:not(.tt-fx-ignore-prm) [data-tt-fx="neon"] { animation: none !important; }
}
[data-tt-fx="pixel_grid"][data-tt-fx-m="always"]::after,
[data-tt-fx="pixel_grid"] .tt-fx-layer--grid {
  content: "" !important;
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(246, 240, 242, calc(var(--tt-fx-a) * 0.55)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 240, 242, calc(var(--tt-fx-a) * 0.55)) 1px, transparent 1px),
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, calc(var(--tt-fx-a) * 0.45)) 100%) !important;
  background-size: 4px 4px, 4px 4px, 100% 100% !important;
  mix-blend-mode: soft-light;
  opacity: 1;
}
[data-tt-fx="pixel_grid"][data-tt-fx-m="always"]::after { content: "" !important; }
[data-tt-fx="pixel_grid"][data-tt-fx-m="hover"]::after {
  content: "" !important;
  opacity: 0;
  transition: opacity .15s steps(2);
}
[data-tt-fx="pixel_grid"][data-tt-fx-m="hover"]:hover::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html:not(.tt-fx-ignore-prm) [data-tt-fx="pixel_grid"]::after,
  html:not(.tt-fx-ignore-prm) .tt-fx-layer--grid { animation: none !important; }
}
[data-tt-fx="shimmer"][data-tt-fx-m="always"]::before,
[data-tt-fx="shimmer"] .tt-fx-layer--shimmer {
  content: "" !important;
  display: block;
  position: absolute;
  left: -12%;
  right: -12%;
  height: 42%;
  top: -46%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 240, 246, calc(var(--tt-fx-a) * 0.45)) 38%,
    rgba(255, 61, 138, calc(var(--tt-fx-a) * 0.95)) 50%,
    rgba(255, 26, 60, calc(var(--tt-fx-a) * 0.55)) 62%,
    transparent 100%
  ) !important;
  mix-blend-mode: screen;
  filter: blur(0.4px);
  animation: tt-fx-roll 4.6s linear infinite !important;
}
[data-tt-fx="shimmer"][data-tt-fx-m="always"]::before { content: "" !important; }
[data-tt-fx="shimmer"][data-tt-fx-m="hover"]::before {
  content: "" !important;
  opacity: 0;
}
[data-tt-fx="shimmer"][data-tt-fx-m="hover"]:hover::before {
  opacity: 1;
  animation: tt-fx-roll 4.6s linear infinite !important;
}
@keyframes tt-fx-roll { to { top: 118%; } }
@media (prefers-reduced-motion: reduce) {
  html:not(.tt-fx-ignore-prm) [data-tt-fx="shimmer"]::before,
  html:not(.tt-fx-ignore-prm) .tt-fx-layer--shimmer { animation: none !important; display: none; }
}
