/* Visuel image-art animé — Image Filter Studio */

.image-art {
  width: 210px;
  height: 235px;
  position: relative;
  justify-self: center;
  align-self: center;
  z-index: 1;
}

.image-art > i,
.image-art > div {
  position: absolute;
  width: 168px;
  height: 205px;
  left: 20px;
  top: 12px;
  border: 2px solid var(--ink);
}

/* Les deux feuilles de dessous */
.image-art > i:first-child {
  background: var(--orange);
  animation: ia-fan-left 7.2s ease-in-out infinite;
}

.image-art > i:nth-child(2) {
  background: var(--blue);
  animation: ia-fan-right 7.2s ease-in-out infinite;
  animation-delay: 0.18s;
}

@keyframes ia-fan-left {
  0%, 100% { transform: rotate(-9deg) translate(-17px, 7px); }
  50%      { transform: rotate(-17deg) translate(-32px, 11px); }
}

@keyframes ia-fan-right {
  0%, 100% { transform: rotate(7deg) translate(17px, -5px); }
  50%      { transform: rotate(15deg) translate(32px, -9px); }
}

/* La photo */
.image-art > div {
  background: var(--paper-2);
  color: var(--ink);
  padding: 20px;
  overflow: hidden;
  box-shadow: 8px 9px 0 var(--ink);
  animation: ia-lift 7.2s ease-in-out infinite;
}

@keyframes ia-lift {
  0%, 100% { transform: translateY(0); box-shadow: 8px 9px 0 var(--ink); }
  50%      { transform: translateY(-6px); box-shadow: 12px 14px 0 var(--ink); }
}

/* Effet 3 — vignettage */
.image-art > div::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  animation: ia-vignette 8s ease-in-out infinite;
}

@keyframes ia-vignette {
  0%, 54%   { box-shadow: inset 0 0 0 0 #11110f00; }
  63%, 95%  { box-shadow: inset 0 0 48px 14px #11110f66; }
  100%      { box-shadow: inset 0 0 0 0 #11110f00; }
}

/* Effet 1 — grain */
.image-art > div::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background-image: radial-gradient(var(--ink) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0;
  animation:
    ia-grain-in 8s ease-in-out infinite,
    ia-grain-jitter 0.35s steps(3, end) infinite;
}

@keyframes ia-grain-in {
  0%, 4%    { opacity: 0; }
  11%, 95%  { opacity: 0.34; }
  100%      { opacity: 0; }
}

@keyframes ia-grain-jitter {
  0%   { background-position: 0 0; }
  33%  { background-position: 2px 1px; }
  66%  { background-position: 1px 2px; }
  100% { background-position: 0 0; }
}

/* Badge IMG */
.image-art b {
  display: inline-block;
  position: relative;
  z-index: 2;
  background: var(--orange);
  color: #fff;
  padding: 5px 7px;
  font: 700 12px/1 "Space Mono", ui-monospace, monospace;
  animation: ia-rgb 8s ease-in-out infinite;
}

/* Les deux barres */
.image-art > div > span {
  display: block;
  position: relative;
  z-index: 2;
  height: 6px;
  background: var(--ink);
  margin-top: 17px;
  transform-origin: left;
  animation: ia-rgb 8s ease-in-out infinite;
}

.image-art > div > span:nth-of-type(2) {
  width: 62%;
  margin-top: 9px;
  animation-delay: 0.08s;
}

/* Les trois pastilles */
.image-art section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 22px;
  position: relative;
  z-index: 2;
}

.image-art em {
  position: relative;
  height: 42px;
  border: 1.5px solid var(--ink);
  background: var(--acid);
  overflow: hidden;
  animation: ia-rgb 8s ease-in-out infinite;
}

.image-art em:nth-child(2) {
  background: var(--purple);
  animation-delay: 0.05s;
}

.image-art em:nth-child(3) {
  background: var(--cyan);
  animation-delay: 0.1s;
}

/* Effet 2 — décalage des canaux RVB */
@keyframes ia-rgb {
  0%, 29%   { box-shadow: none; }
  36%, 95%  { box-shadow: -4px 0 0 #ff5c35b3, 4px 0 0 #56b8ffb3; }
  100%      { box-shadow: none; }
}

/* Effet 4 — quantification des couleurs */
.image-art em::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    180deg,
    #ffffff59 0 33%,
    #11110f00 33% 66%,
    #11110f4d 66% 100%
  );
  opacity: 0;
  animation: ia-posterize 8s steps(1, end) infinite;
}

@keyframes ia-posterize {
  0%, 78%   { opacity: 0; }
  80%, 95%  { opacity: 1; }
  100%      { opacity: 0; }
}

/* Étiquette de l'effet en cours */
.image-art .fx {
  position: absolute;
  top: -6px;
  right: -14px;
  z-index: 6;
  width: 74px;
  height: 24px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--acid);
  box-shadow: 3px 3px 0 var(--ink);
  text-decoration: none;
}

.image-art .fx i {
  display: block;
  position: static;
  width: auto;
  height: auto;
  left: auto;
  top: auto;
  border: 0;
  background: transparent;
  animation: ia-ticker 8s steps(4, end) infinite;
}

.image-art .fx s {
  display: grid;
  place-items: center;
  height: 20px;
  font: 700 8px/1 "Space Mono", ui-monospace, monospace;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
}

@keyframes ia-ticker {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-80px); }
}

@media (prefers-reduced-motion: reduce) {
  .image-art *,
  .image-art > div::before,
  .image-art > div::after {
    animation: none !important;
  }

  .image-art > i:first-child  { transform: rotate(-9deg) translate(-17px, 7px); }
  .image-art > i:nth-child(2) { transform: rotate(7deg) translate(17px, -5px); }
  .image-art > div::after      { opacity: 0.28; }
  .image-art > div::before     { box-shadow: inset 0 0 40px 12px #11110f4d; }
  .image-art em::after         { opacity: 1; }
  .image-art .fx i             { transform: translateY(0); }
}
