/* Service card visuals for Branding, Strategy, Paid Media and Digital Marketing.
   Each plays one calm sequence while in view (service-visuals.js adds .is-inview) and then loops. */
.svc {
  /* The Verve palette: coral, pink, purple and blue. */
  --svc-navy: #a259ff;
  --svc-blue: #2997ff;
  --svc-sky: #ff3d8b;
  --svc-orange: #ff7a59;
  --svc-mist: #f3eefc;
  --svc-verve: linear-gradient(120deg, #ff7a59, #ff3d8b 35%, #a259ff 65%, #2997ff);
  --svc-ink: #06070a;
  --svc-grey: #6b7280;
  --svc-ease: cubic-bezier(.22, 1, .36, 1);
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 230px;
  padding: 14px;
  overflow: hidden;
  color: var(--svc-ink);
  font-family: var(--font, "Poppins", sans-serif);
  background: #fff;
  border: 1px solid rgba(2, 3, 6, .07);
  border-radius: 18px;
}

.svc *,
.svc *::before,
.svc *::after {
  animation-play-state: paused;
}

.svc.is-inview *,
.svc.is-inview *::before,
.svc.is-inview *::after {
  animation-play-state: running;
}

.svc__caption {
  margin: auto 0 0;
  padding-top: 10px;
  color: var(--svc-grey);
  font-size: 11px;
  line-height: 1.4;
}

/* ---------- Branding: a palette is chosen, then applied to a business card ---------- */
.svc-brand__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.svc-brand__card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1.6;
  padding: 10px;
  border-radius: 10px;
  background: var(--svc-verve) no-repeat bottom / 100% 0;
  background-color: var(--svc-mist);
  box-shadow: 0 6px 16px rgba(6, 7, 10, .08);
  animation: svc-brand-card 9s var(--svc-ease) infinite;
}

.svc-brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #c9d3dc;
  animation: svc-brand-mark 9s var(--svc-ease) infinite;
}

.svc-brand__lines i {
  display: block;
  height: 4px;
  margin-top: 4px;
  border-radius: 2px;
  background: rgba(6, 7, 10, .16);
  animation: svc-brand-lines 9s var(--svc-ease) infinite;
}

.svc-brand__lines i:first-child { width: 70%; }
.svc-brand__lines i:last-child { width: 45%; }

.svc-brand__type {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px;
  border-radius: 10px;
  background: #f5f7fa;
}

.svc-brand__type b {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
}

.svc-brand__type small {
  margin-top: 6px;
  color: var(--svc-grey);
  font-size: 10px;
}

.svc-brand__swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.svc-brand__swatches i {
  height: 30px;
  border-radius: 7px;
  background: var(--c);
  transform-origin: bottom;
  animation: svc-swatch 9s var(--svc-ease) infinite;
}

.svc-brand__swatches i:nth-child(2) { animation-delay: .12s; }
.svc-brand__swatches i:nth-child(3) { animation-delay: .24s; }
.svc-brand__swatches i:nth-child(4) { animation-delay: .36s; }
.svc-brand__swatches i:nth-child(5) { animation-delay: .48s; }

@keyframes svc-swatch {
  0%, 4% { opacity: 0; transform: scaleY(.2); }
  14%, 88% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; transform: scaleY(.2); }
}

@keyframes svc-brand-card {
  0%, 30% { background-color: var(--svc-mist); background-size: 100% 0; }
  42%, 88% { background-color: var(--svc-navy); background-size: 100% 100%; }
  96%, 100% { background-color: var(--svc-mist); background-size: 100% 0; }
}

@keyframes svc-brand-mark {
  0%, 34% { background: #c9d3dc; transform: none; }
  46%, 88% { background: #fff; transform: rotate(45deg) scale(.8); }
  96%, 100% { background: #c9d3dc; transform: none; }
}

@keyframes svc-brand-lines {
  0%, 36% { background: rgba(6, 7, 10, .16); }
  48%, 88% { background: rgba(255, 255, 255, .7); }
  96%, 100% { background: rgba(6, 7, 10, .16); }
}

/* ---------- Strategy: a line is drawn through four steps ---------- */
.svc-chart {
  position: relative;
  flex: 1;
  min-height: 130px;
}

.svc-chart svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.svc-chart__grid {
  stroke: rgba(6, 7, 10, .07);
  stroke-width: 1;
}

.svc-chart__line {
  fill: none;
  stroke: var(--svc-navy);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: svc-draw 8s var(--svc-ease) infinite;
}

.svc-chart__area {
  fill: url(#svc-area);
  opacity: 0;
  animation: svc-area 8s ease infinite;
}

.svc-chart__line,
.svc-chart__grid {
  vector-effect: non-scaling-stroke;
}

/* Points are HTML so they stay round while the chart stretches to fit the card. */
.svc-chart__point {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--svc-navy);
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: svc-point 8s var(--svc-ease) infinite;
}

.svc-chart__point:nth-of-type(2) { animation-delay: .5s; }
.svc-chart__point:nth-of-type(3) { animation-delay: 1s; }
.svc-chart__point:nth-of-type(4) { animation-delay: 1.5s; border-color: var(--svc-orange); }

@keyframes svc-draw {
  0%, 4% { stroke-dashoffset: 400; }
  34%, 88% { stroke-dashoffset: 0; }
  96%, 100% { stroke-dashoffset: 400; opacity: 0; }
}

@keyframes svc-area {
  0%, 30% { opacity: 0; }
  42%, 86% { opacity: 1; }
  96%, 100% { opacity: 0; }
}

@keyframes svc-point {
  0%, 10% { opacity: 0; }
  16%, 88% { opacity: 1; }
  96%, 100% { opacity: 0; }
}

.svc-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.svc-steps li {
  padding: 6px 0;
  color: var(--svc-grey);
  font-size: 10.5px;
  font-weight: 500;
  text-align: center;
  border-radius: 999px;
  background: #f3f5f8;
  animation: svc-step 8s var(--svc-ease) infinite;
}

.svc-steps li:nth-child(2) { animation-delay: .5s; }
.svc-steps li:nth-child(3) { animation-delay: 1s; }
.svc-steps li:nth-child(4) { animation-delay: 1.5s; }

@keyframes svc-step {
  0%, 10% { color: var(--svc-grey); background: #f3f5f8; }
  16%, 88% { color: #fff; background: var(--svc-navy); }
  96%, 100% { color: var(--svc-grey); background: #f3f5f8; }
}

/* ---------- Paid Media: an audience is narrowed, then the ad goes live ---------- */
.svc-paid__targets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.svc-paid__targets span {
  padding: 4px 8px;
  color: var(--svc-grey);
  font-size: 10px;
  font-weight: 500;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(6, 7, 10, .1);
  animation: svc-target 9s var(--svc-ease) infinite;
}

.svc-paid__targets span:nth-child(2) { animation-delay: .35s; }
.svc-paid__targets span:nth-child(3) { animation-delay: .7s; }

@keyframes svc-target {
  0%, 6% { color: var(--svc-grey); background: transparent; }
  12%, 88% { color: #fff; background: var(--svc-blue); box-shadow: none; }
  96%, 100% { color: var(--svc-grey); background: transparent; }
}

.svc-ad {
  margin-top: 10px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(6, 7, 10, .08), 0 10px 24px rgba(6, 7, 10, .08);
  opacity: 0;
  transform: translateY(14px);
  animation: svc-ad 9s var(--svc-ease) infinite;
}

.svc-ad__image {
  height: 30px;
  background:
    var(--svc-verve);
}

.svc-ad__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}

.svc-ad__body small {
  display: block;
  color: var(--svc-orange);
  font-size: 9px;
  font-weight: 600;
}

.svc-ad__body strong {
  display: block;
  font-size: 11px;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: -.02em;
}

.svc-ad__body em {
  flex: none;
  padding: 4px 8px;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  border-radius: 999px;
  background: var(--svc-navy);
}

@keyframes svc-ad {
  0%, 16% { opacity: 0; transform: translateY(14px); }
  26%, 88% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; transform: translateY(14px); }
}

.svc-paid__metric {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--svc-grey);
  font-size: 10px;
}

.svc-paid__metric span {
  position: relative;
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #eef1f5;
}

.svc-paid__metric span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--svc-orange);
  transform-origin: left;
  transform: scaleX(0);
  animation: svc-reach 9s var(--svc-ease) infinite;
}

@keyframes svc-reach {
  0%, 30% { transform: scaleX(0); }
  62%, 88% { transform: scaleX(.78); }
  96%, 100% { transform: scaleX(0); }
}

/* ---------- Digital Marketing: a week of content gets scheduled ---------- */
.svc-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  flex: 1;
}

.svc-week__day {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 112px;
  padding: 5px 4px;
  border-radius: 8px;
  background: #f5f7fa;
}

.svc-week__day > b {
  color: var(--svc-grey);
  font-size: 9px;
  font-weight: 600;
  text-align: center;
}

.svc-week__post {
  height: 22px;
  border-radius: 5px;
  background: var(--c);
  opacity: 0;
  transform: translateY(-8px);
  animation: svc-post 10s var(--svc-ease) infinite;
  animation-delay: var(--d);
}

.svc-week__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 8px 0 0;
  color: var(--svc-grey);
  font-size: 9.5px;
}

.svc-week__legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.svc-week__legend span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--c);
}

@keyframes svc-post {
  0%, 4% { opacity: 0; transform: translateY(-8px); }
  10%, 88% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; transform: translateY(-8px); }
}

.svc-week__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--svc-ink);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  animation: svc-status 10s ease infinite;
}

.svc-week__status::before {
  content: "";
  width: 10px;
  height: 5px;
  margin-top: -3px;
  border-bottom: 2px solid #1a9e55;
  border-left: 2px solid #1a9e55;
  transform: rotate(-45deg);
}

@keyframes svc-status {
  0%, 40% { opacity: 0; }
  48%, 88% { opacity: 1; }
  96%, 100% { opacity: 0; }
}

/* Reduced motion: show every visual in its finished state. */
@media (prefers-reduced-motion: reduce) {
  .svc *,
  .svc *::before,
  .svc *::after {
    animation: none !important;
  }

  .svc-ad,
  .svc-week__post,
  .svc-week__status,
  .svc-chart__area,
  .svc-chart__point {
    opacity: 1;
    transform: none;
  }

  .svc-chart__line { stroke-dashoffset: 0; }
  .svc-paid__metric span::after { transform: scaleX(.78); }
  .svc-brand__card { background-size: 100% 100%; }
  .svc-brand__mark { background: #fff; }
  .svc-steps li:last-child,
  .svc-paid__targets span { color: #fff; background: var(--svc-navy); }
}
