/*
 * Source-bound offer emphasis. Load after campaigns.css.
 * Add data-festive to each .campaign-screen .aqua-photo-main so the shared
 * visibility controller owns --festive-state and decoded-image arrival state.
 * Completed loops survive re-entry; each arrival starts a fresh trace.
 * No JS means a static line.
 * Paths, viewBox, image dimensions and contain registration stay unchanged.
 */
.campaign-screen .aqua-photo-main .aqua-contours {
  display: block;
  color: #ffe2a6;
  z-index: 2;
  pointer-events: none;
}

.campaign-screen .aqua-photo-main .aqua-contour-base {
  opacity: .52;
}

.campaign-screen .aqua-photo-main .aqua-contour-base path[data-feature="treatment"] {
  stroke-width: 1.25;
  opacity: 1;
}

.campaign-screen .aqua-photo-main .aqua-contour-base path[data-feature="contour"] {
  stroke-width: 1;
  opacity: .26;
}

/* Cancel the old 1.8s arrival animation, which faded the whole group away. */
.campaign-screen .aqua-photo.aqua-photo-main .aqua-contour-trace {
  animation: none;
  opacity: 1;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
}

.campaign-screen .aqua-photo-main .aqua-contour-trace path {
  stroke-width: 1.8;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
  opacity: 0;
  filter: drop-shadow(0 0 1px #382616);
}

/* Only the existing treatment marks move; supporting facial edges stay quiet. */
.campaign-screen .aqua-photo-main .aqua-contour-trace path[data-feature="contour"] {
  display: none;
}

.campaign-screen .aqua-photo-main[data-festive][data-contour-ready] .aqua-contour-trace path[data-feature="treatment"] {
  animation: offer-treatment-trace 6s cubic-bezier(.3, .05, .3, 1) 0s var(--offer-trace-iterations, 10) both;
  /* Override the shared festive ten-loop cap with this photo's remaining cap. */
  animation-iteration-count: var(--offer-trace-iterations, 10) !important;
  animation-play-state: var(--festive-state, paused);
}

.campaign-screen .aqua-photo-main[data-festive][data-contour-ready] .aqua-contour-trace path[data-feature="treatment"]:nth-child(2) {
  animation-delay: .28s;
}

@keyframes offer-treatment-trace {
  0% { stroke-dashoffset: 100; opacity: .95; }
  42%, 72% { stroke-dashoffset: 0; opacity: .95; }
  90%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

/* A thin resting line remains after ten loops and for reduced/no motion. */
html[data-motion="reduced"] .campaign-screen .aqua-photo-main .aqua-contours {
  display: block;
}

html[data-motion="reduced"] .campaign-screen .aqua-photo-main[data-festive][data-ready] .aqua-contour-trace path[data-feature="treatment"] {
  animation: none;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce), print {
  .campaign-screen .aqua-photo-main .aqua-contours {
    display: block;
  }

  .campaign-screen .aqua-photo-main[data-festive][data-ready] .aqua-contour-trace path[data-feature="treatment"] {
    animation: none;
    opacity: 0;
  }
}
